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