diff --git a/include/blt/std/assert.h b/include/blt/std/assert.h index 45934d5..5962720 100644 --- a/include/blt/std/assert.h +++ b/include/blt/std/assert.h @@ -7,24 +7,6 @@ #ifndef BLT_ASSERT_H #define BLT_ASSERT_H -#ifdef __GNUC__ - - #include - #include - -#endif - -#ifdef __GNUC__ - #define BLT_STACK_TRACE(number) void* ptrs[number]; \ - int size = backtrace(ptrs, number); \ - char** messages = backtrace_symbols(ptrs, size); - - #define BLT_FREE_STACK_TRACE() free(messages); -#else - #define BLT_STACK_TRACE(number) void(); - #define BLT_FREE_STACK_TRACE() void(); -#endif - namespace blt { void printStacktrace(char** messages, int size, const char* path, int line); diff --git a/src/blt/std/assert.cpp b/src/blt/std/assert.cpp index 5472479..124c277 100644 --- a/src/blt/std/assert.cpp +++ b/src/blt/std/assert.cpp @@ -10,6 +10,24 @@ #include #include +#ifdef __GNUC__ + + #include + #include + +#endif + +#ifdef __GNUC__ + #define BLT_STACK_TRACE(number) void* ptrs[number]; \ + int size = backtrace(ptrs, number); \ + char** messages = backtrace_symbols(ptrs, size); + + #define BLT_FREE_STACK_TRACE() free(messages); +#else +#define BLT_STACK_TRACE(number) void(); + #define BLT_FREE_STACK_TRACE() void(); +#endif + namespace blt { static inline std::string _macro_filename(const std::string& path){