aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-07-28 17:25:58 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-28 17:25:58 +0200
commite5821148c6b469a48f536b4cd18f06fd5be20e1f (patch)
tree2ea1fe6b3285a4b8450821c070a6c31d67b2a7a7 /include
parent45ba8188d181c4b9316366f89fc955956c26e502 (diff)
Fix build issues in release 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