Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 30c4005 in mainline for uspace/lib/c/include/assert.h


Ignore:
Timestamp:
2011-04-29T19:56:07Z (11 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master
Children:
2874547
Parents:
6b40ea7 (diff), afdcc60e (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.
Message:

Merge mainline improvements

File:
1 edited

Legend:

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

    r6b40ea7 r30c4005  
    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 
    5249#ifndef NDEBUG
    5350
    5451#define assert(expr) \
    5552        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__); \
    6155        } while (0)
    6256
     
    6761#endif /* NDEBUG */
    6862
     63extern void assert_abort(const char *, const char *, unsigned int)
     64    __attribute__((noreturn));
     65
    6966#endif
    7067
Note: See TracChangeset for help on using the changeset viewer.