Changeset 3375bd4 in mainline for uspace/lib/c/include/assert.h
- Timestamp:
- 2011-05-17T07:44:17Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 04c418d, 2586860, 5e6e50b
- Parents:
- 72cd53d (diff), 0d8a304 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/assert.h
r72cd53d r3375bd4 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.