123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #undef NDEBUG
- #include <assert.h>
- #undef assert
- #define ASSERT_SHOW_PROGNAME 1
- static smallint in_assert;
- void __assert(const char *assertion, const char * filename,
- unsigned int linenumber, register const char * function)
- {
- if (!in_assert) {
- in_assert = 1;
- fprintf(stderr,
- #ifdef ASSERT_SHOW_PROGNAME
- "%s: %s: %d: %s: Assertion `%s' failed.\n", __uclibc_progname,
- #else
- "%s: %d: %s: Assertion `%s' failed.\n",
- #endif
- filename,
- linenumber,
-
- ((function == NULL) ? "?function?" : function),
- assertion
- );
- }
-
- abort();
- }
- libc_hidden_def(__assert)
|