123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #define _STDIO_UTILITY
- #include <stdio.h>
- #include <stdlib.h>
- #include <unistd.h>
- #undef NDEBUG
- #include <assert.h>
- #undef assert
- #if 1
- void __assert(const char *assertion, const char * filename,
- int linenumber, register const char * function)
- {
- fprintf(stderr,
- #if 0
-
- "%s: %s: %d: %s: Assertion `%s' failed.\n", program_name,
- #else
- "%s: %d: %s: Assertion `%s' failed.\n",
- #endif
- filename,
- linenumber,
-
- ((function == NULL) ? "?function?" : function),
- assertion
- );
- abort();
- }
- #else
- void __assert(const char *assertion, const char * filename,
- int linenumber, register const char * function)
- {
- char buf[__BUFLEN_INT10TOSTR];
- _stdio_fdout(STDERR_FILENO,
- #if 0
- program_name,
- ": ",
- #endif
- filename,
- ":",
- _int10tostr(buf+sizeof(buf)-1, linenumber),
- ": ",
-
- ((function == NULL) ? "?function?" : function),
- ": Assertion `",
- assertion,
- "' failed.\n",
- NULL
- );
- abort();
- }
- #endif
|