source: trunk/src/stl/assert.cc @ 376

Last change on this file since 376 was 376, checked in by epyon, 10 years ago
  • stl/assert.hh, stl/capi.hh, size_t independent
  • GCC 4.8 compatibility
  • using template usage
  • various minor changes
File size: 1.3 KB
Line 
1// Copyright (C) 2015 ChaosForge Ltd
2// http://chaosforge.org/
3//
4// This file is part of NV Libraries.
5// For conditions of distribution and use, see copyright notice in nv.hh
6
7#define NV_CORE_COMMON_HH
8#define NV_INTERNAL_INCLUDE
9#include "nv/stl/assert.hh"
10#undef NV_CORE_COMMON_HH
11
12#if NV_COMPILER == NV_MSVC
13
14#       if NV_DEBUG
15
16extern "C" {
17        void __cdecl _wassert( const wchar_t * _Message, const wchar_t *_File, unsigned _Line );
18}
19
20void nv_internal_assert( const wchar_t * message, const wchar_t* file, unsigned line )
21{
22        _wassert( message, file, line );
23}
24#       else 
25        void nv_internal_assert( const wchar_t *, const wchar_t*, unsigned ) {}
26#       endif  // NV_DEBUG
27#else // NV_COMPILER
28
29#       if NV_DEBUG
30#       if NV_COMPILER == NV_CLANG
31extern "C" {
32        extern void __assert(const char *, const char *, unsigned int, const char *)
33                throw() __attribute__ ((__noreturn__));
34}
35#       else
36#include <assert.h>
37#       endif
38void nv_internal_assert( const char * assertion, const char * file, unsigned int line, const char * function )
39{
40#       if NV_COMPILER == NV_CLANG
41        __assert(assertion, file, line, function );
42#       else
43        __assert_fail(assertion, file, line, function );
44#       endif
45}
46#       else
47void nv_internal_assert( const char * , const char * , unsigned int , const char * )
48{
49}
50#       endif
51
52#endif // NV_COMPILER
53
Note: See TracBrowser for help on using the repository browser.