Rev 4973 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | /* Copyright (C) 1997 DJ Delorie, see COPYING.DJ for details */ |
2 | #ifndef __dj_ENFORCE_ANSI_FREESTANDING |
||
3 | |||
4 | #undef assert |
||
5 | #undef unimpl |
||
6 | |||
5123 | clevermous | 7 | #ifdef NDEBUG |
8 | #define assert(test) /*nothing*/ |
||
9 | #else |
||
4973 | right-hear | 10 | #define assert(test) ((void)((test)||(__dj_assert(#test,__FILE__,__LINE__),0))) |
5123 | clevermous | 11 | #endif |
4973 | right-hear | 12 | #define unimpl() __dj_unimp("Called unimplemented function in file \"" __FILE__ "\"\n") |
13 | |||
14 | #ifndef __dj_include_assert_h_ |
||
15 | #define __dj_include_assert_h_ |
||
16 | |||
17 | #ifdef __cplusplus |
||
18 | extern "C" { |
||
19 | #endif |
||
20 | |||
21 | #ifdef _MSC_VER |
||
22 | void __declspec(noreturn) __dj_assert(const char *,const char *,int); |
||
23 | void __declspec(noreturn) __dj_unimp(const char *fn); |
||
24 | #else |
||
25 | void __dj_assert(const char *,const char *,int) __attribute__((__noreturn__)); |
||
26 | void __dj_unimp(const char *fn) __attribute__((__noreturn__)); |
||
27 | #endif |
||
28 | |||
29 | #ifdef __cplusplus |
||
30 | } |
||
31 | #endif |
||
32 | |||
33 | #endif /* !__dj_include_assert_h_ */ |
||
34 | |||
35 | #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */ |