Changeset eb522e8 in mainline for uspace/lib/c/include/assert.h
- Timestamp:
- 2011-06-01T08:43:42Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8d6c1f1
- Parents:
- 9e2e715 (diff), e51a514 (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
r9e2e715 reb522e8 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> 49 #ifndef NDEBUG 51 50 52 #ifndef NDEBUG 53 # define assert(expr) \ 54 do { \ 55 if (!(expr)) { \ 56 printf("Assertion failed (%s) at file '%s', " \ 57 "line %d.\n", #expr, __FILE__, __LINE__); \ 58 abort(); \ 59 } \ 60 } while (0) 61 #else 62 # define assert(expr) 63 #endif 51 #define assert(expr) \ 52 do { \ 53 if (!(expr)) \ 54 assert_abort(#expr, __FILE__, __LINE__); \ 55 } while (0) 56 57 #else /* NDEBUG */ 58 59 #define assert(expr) 60 61 #endif /* NDEBUG */ 62 63 extern void assert_abort(const char *, const char *, unsigned int) 64 __attribute__((noreturn)); 64 65 65 66 #endif
Note:
See TracChangeset
for help on using the changeset viewer.