From 215220f98b0ac4a87fe4a233de16650cf6d0b968 Mon Sep 17 00:00:00 2001 From: Brett Date: Thu, 7 Sep 2023 00:23:13 -0400 Subject: [PATCH] move defines to c++ --- include/blt/std/assert.h | 18 ------------------ src/blt/std/assert.cpp | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) 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){