]> rtime.felk.cvut.cz Git - l4.git/blobdiff - kernel/fiasco/src/lib/minilibc/include/assert.h
update
[l4.git] / kernel / fiasco / src / lib / minilibc / include / assert.h
index 71282e4fd20cc6e183bb0ed53026515e6799c141..e8e0c8402bdfd5c061cadff2ac380373f1b4c388 100644 (file)
@@ -2,6 +2,7 @@
 #define _ASSERT_H
 
 #include <cdefs.h>
+#include <fiasco_defs.h>
 
 #if (__GNUC__>=3)
 #  define ASSERT_EXPECT_FALSE(exp)     __builtin_expect((exp), 0)
@@ -18,7 +19,7 @@
 #else
 __BEGIN_DECLS
 /* This prints an "Assertion failed" message and aborts.  */
-void __assert_fail (const char *__assertion, const char *__file,
+void FIASCO_COLD __assert_fail (const char *__assertion, const char *__file,
                    unsigned int __line, void *ret)
      __attribute__ ((__noreturn__));
 
@@ -30,13 +31,11 @@ __END_DECLS
  * can be found by searching the EIP in the kernel image. */
 #  undef assert
 #  ifdef NDEBUG
-#    define assert(expr)  do { } while (0)
+#    define assert(expr)  do {} while (0)
 #    define check(expr) (void)(expr)
 #  else
 #    define assert(expr)                                               \
-     ((void) ((ASSERT_EXPECT_FALSE(!(expr)))                   \
-       ? (__assert_fail (#expr, __FILE__, __LINE__, __builtin_return_address(0)), 0)   \
-       : 0))
+     do { if (ASSERT_EXPECT_FALSE(!(expr))) __assert_fail (#expr, __FILE__, __LINE__, __builtin_return_address(0)); } while (0)
 #  endif
 #endif