diff options
Diffstat (limited to 'libpsn00b/include/assert.h')
| -rw-r--r-- | libpsn00b/include/assert.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libpsn00b/include/assert.h b/libpsn00b/include/assert.h index 12212af..1b2bda2 100644 --- a/libpsn00b/include/assert.h +++ b/libpsn00b/include/assert.h @@ -11,8 +11,16 @@ #include <stdio.h> +#ifdef __cplusplus +extern "C" { +#endif + void _assert_abort(const char *file, int line, const char *expr); +#ifdef __cplusplus +} +#endif + #ifdef NDEBUG #define assert(expr) @@ -20,9 +28,8 @@ void _assert_abort(const char *file, int line, const char *expr); #else -#define assert(expr) { \ - if (!(expr)) _assert_abort(__FILE__, __LINE__, #expr); \ -} +#define assert(expr) \ + ((expr) ? ((void) 0) : _assert_abort(__FILE__, __LINE__, #expr)) #ifdef SDK_LIBRARY_NAME #define _sdk_log(fmt, ...) printf(SDK_LIBRARY_NAME ": " fmt, ##__VA_ARGS__) |
