Changes in uspace/lib/c/include/assert.h [202f57b:c7bbf029] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/assert.h
r202f57b rc7bbf029 40 40 * 41 41 * If NDEBUG is not set, the assert() macro 42 * evaluates expr and if it is false prints 42 * evaluates expr and if it is false prints 43 43 * error message and terminate program. 44 44 * … … 47 47 */ 48 48 49 #include <stdio.h>50 #include <stdlib.h>51 52 49 #ifndef NDEBUG 53 50 54 51 #define assert(expr) \ 55 52 do { \ 56 if (!(expr)) { \ 57 printf("Assertion failed (%s) at file '%s', " \ 58 "line %d.\n", #expr, __FILE__, __LINE__); \ 59 abort(); \ 60 } \ 53 if (!(expr)) \ 54 assert_abort(#expr, __FILE__, __LINE__); \ 61 55 } while (0) 62 56 … … 67 61 #endif /* NDEBUG */ 68 62 63 extern void assert_abort(const char *, const char *, unsigned int) 64 __attribute__((noreturn)); 65 69 66 #endif 70 67
Note:
See TracChangeset
for help on using the changeset viewer.