diff options
Diffstat (limited to 'asl/base/assert.hpp')
-rw-r--r-- | asl/base/assert.hpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/asl/base/assert.hpp b/asl/base/assert.hpp index 5aeb161..a899564 100644 --- a/asl/base/assert.hpp +++ b/asl/base/assert.hpp @@ -24,15 +24,17 @@ void report_assert_failure(const char* msg, const source_location& sl = source_l #define ASL_DEBUG_BREAK() __builtin_debugtrap() #endif -// @Todo Configure asserts at build time - -#define ASL_ASSERT(...) \ - if (__VA_ARGS__) {} \ - else \ - { \ - ::asl::report_assert_failure(#__VA_ARGS__); \ - ASL_DEBUG_BREAK(); \ - } +#if !ASL_OPTIMIZED + #define ASL_ASSERT(...) \ + if (__VA_ARGS__) {} \ + else \ + { \ + ::asl::report_assert_failure(#__VA_ARGS__); \ + ASL_DEBUG_BREAK(); \ + } +#else + #define ASL_ASSERT(...) +#endif #define ASL_ASSERT_RELEASE(...) \ if (__VA_ARGS__) {} \ |