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
#error "_compiler_brk is not implemented for this compiler"
#endif
#define _compiler_curfunc __FUNCTION__

View File

@ -1,6 +1,11 @@
#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(
char *cond,
@ -18,9 +23,9 @@ extern void _assert_error(
if(!(condition)) { \
_assert_error( \
#condition, \
_compiler_curfunc, \
__func__, \
__FILE__, \
_str(__LINE__)); \
_assert_str(__LINE__)); \
} \
} while(0)
#endif