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

Last change on this file since 382 was 378, checked in by epyon, 10 years ago
  • important fix in reverse_iterator operators
  • std::string functions removed or converted to string_ref in string.hh
  • capi.hh - more function forwards and usage of them instead of libc
  • more std removal
  • assert fix
File size: 1.4 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
36extern "C" {
37        extern void __assert_fail(const char *, const char *, unsigned int, const char *)
38                throw() __attribute__ ((__noreturn__));
39}
40#       endif
41void nv_internal_assert( const char * assertion, const char * file, unsigned int line, const char * function )
42{
43#       if NV_COMPILER == NV_CLANG
44        __assert(assertion, file, line, function );
45#       else
46        __assert_fail(assertion, file, line, function );
47#       endif
48}
49#       else
50void nv_internal_assert( const char * , const char * , unsigned int , const char * )
51{
52}
53#       endif
54
55#endif // NV_COMPILER
56
Note: See TracBrowser for help on using the repository browser.