|
@@ -14,11 +14,11 @@ __BEGIN_DECLS
|
|
|
__attribute__((noreturn)) void __assertion_failed(const char* msg);
|
|
|
# define __stringify_helper(x) # x
|
|
|
# define __stringify(x) __stringify_helper(x)
|
|
|
-# define assert(expr) \
|
|
|
- do { \
|
|
|
- if (__builtin_expect(!(expr), 0)) \
|
|
|
- __assertion_failed(#expr "\n" __FILE__ ":" __stringify(__LINE__)); \
|
|
|
- } while (0)
|
|
|
+# define assert(expr) \
|
|
|
+ (__builtin_expect(!(expr), 0) \
|
|
|
+ ? __assertion_failed(#expr "\n" __FILE__ ":" __stringify(__LINE__)) \
|
|
|
+ : void(0))
|
|
|
+
|
|
|
#else
|
|
|
# define assert(expr) ((void)(0))
|
|
|
# define VERIFY_NOT_REACHED() _abort()
|