From e5821148c6b469a48f536b4cd18f06fd5be20e1f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 28 Jul 2020 17:25:58 +0200 Subject: Fix build issues in release mode --- include/std/misc.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/std/misc.h') 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 +#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 -- cgit v1.2.3