Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/assert.h

    rc7bbf029 r202f57b  
    4040 *
    4141 * 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 
    4343 * error message and terminate program.
    4444 *
     
    4747 */
    4848
     49#include <stdio.h>
     50#include <stdlib.h>
     51
    4952#ifndef NDEBUG
    5053
    5154#define assert(expr) \
    5255        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                } \
    5561        } while (0)
    5662
     
    6167#endif /* NDEBUG */
    6268
    63 extern void assert_abort(const char *, const char *, unsigned int)
    64     __attribute__((noreturn));
    65 
    6669#endif
    6770
Note: See TracChangeset for help on using the changeset viewer.