From 215a596d218e2e9c68816fdc15c334978cfc7956 Mon Sep 17 00:00:00 2001 From: Brett Date: Wed, 31 Jan 2024 17:13:22 -0500 Subject: [PATCH] assert print function --- include/blt/std/assert.h | 2 ++ src/blt/std/assert.cpp | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/include/blt/std/assert.h b/include/blt/std/assert.h index b36cb8a..385f13f 100644 --- a/include/blt/std/assert.h +++ b/include/blt/std/assert.h @@ -16,6 +16,8 @@ namespace blt void b_assert_failed(const char* expression, const char* path, int line); void b_throw(const char* what, const char* path, int line); + + bool assert_print(const char* what); } // prints error with stack trace if assertion fails. Does not stop execution. diff --git a/src/blt/std/assert.cpp b/src/blt/std/assert.cpp index d41cf29..25fabbd 100644 --- a/src/blt/std/assert.cpp +++ b/src/blt/std/assert.cpp @@ -107,5 +107,11 @@ namespace blt { #endif } + bool assert_print(const char* what) + { + BLT_ERROR(what); + return true; + } + } \ No newline at end of file