diff --git a/inc/_compiler.h b/inc/_compiler.h index 35408bf..189d069 100644 --- a/inc/_compiler.h +++ b/inc/_compiler.h @@ -32,5 +32,3 @@ #else #error "_compiler_brk is not implemented for this compiler" #endif - -#define _compiler_curfunc __FUNCTION__ diff --git a/inc/assert.h b/inc/assert.h index dd950b8..d3d5122 100644 --- a/inc/assert.h +++ b/inc/assert.h @@ -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