aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/std/misc.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/std/misc.h b/include/std/misc.h
index 03d7972..ecbdac5 100644
--- a/include/std/misc.h
+++ b/include/std/misc.h
@@ -3,6 +3,7 @@
#include "types.h"
#include <sys/types.h>
+#include "log.h"
#if defined(__BYTE_ORDER)
#if __BYTE_ORDER == __LITTLE_ENDIAN
@@ -26,10 +27,6 @@ u16 byteswap16(u16 value);
u32 byteswap32(u32 value);
u64 byteswap64(u64 value);
-#ifndef AMAL_PEDANTIC
-#include "log.h"
-#endif
-
#ifdef AMAL_PEDANTIC
#define throw_debug_msg do {} while(0)
#else
@@ -70,4 +67,7 @@ typedef struct {
#define ignore_result_int(expr) (void)((expr)+1)
+void check_abort() __THROW __attribute__ ((__noreturn__));
+#define check(cond) do { if(!(cond)) { amal_log_error("compiler-bug: condition failed: " # cond); check_abort(); } } while(0)
+
#endif