Move macros into assert.h

This commit is contained in:
bumbread 2022-06-12 07:21:57 +11:00
parent 343ca0058e
commit 105251088f
2 changed files with 9 additions and 6 deletions

View File

@ -32,5 +32,3 @@
#else #else
#error "_compiler_brk is not implemented for this compiler" #error "_compiler_brk is not implemented for this compiler"
#endif #endif
#define _compiler_curfunc __FUNCTION__

View File

@ -1,6 +1,11 @@
#pragma once #pragma once
#include "_compiler.h"
#include "_macros.h" #if !defined(__func__)
#define __func__ __FUNCTION__
#endif
#define _assert_str_(x) #x
#define _assert_str(x) _assert_str_(x)
extern void _assert_error( extern void _assert_error(
char *cond, char *cond,
@ -18,9 +23,9 @@ extern void _assert_error(
if(!(condition)) { \ if(!(condition)) { \
_assert_error( \ _assert_error( \
#condition, \ #condition, \
_compiler_curfunc, \ __func__, \
__FILE__, \ __FILE__, \
_str(__LINE__)); \ _assert_str(__LINE__)); \
} \ } \
} while(0) } while(0)
#endif #endif