Changes in uspace/lib/c/include/assert.h [c7bbf029:202f57b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/assert.h
rc7bbf029 r202f57b 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 49 52 #ifndef NDEBUG 50 53 51 54 #define assert(expr) \ 52 55 do { \ 53 if (!(expr)) \ 54 assert_abort(#expr, __FILE__, __LINE__); \ 56 if (!(expr)) { \ 57 printf("Assertion failed (%s) at file '%s', " \ 58 "line %d.\n", #expr, __FILE__, __LINE__); \ 59 abort(); \ 60 } \ 55 61 } while (0) 56 62 … … 61 67 #endif /* NDEBUG */ 62 68 63 extern void assert_abort(const char *, const char *, unsigned int)64 __attribute__((noreturn));65 66 69 #endif 67 70
Note:
See TracChangeset
for help on using the changeset viewer.