diff options
author | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-05-26 22:38:04 +0200 |
---|---|---|
committer | Steven Le Rouzic <steven.lerouzic@gmail.com> | 2025-05-26 22:38:04 +0200 |
commit | b8a87223bb70fccc47ba0f9c96b3f58de6e1e5bd (patch) | |
tree | 212ad4e788509f9e3c6b2bc41120c8687298dcb4 /asl/base/assert.hpp | |
parent | a1db1cd9e22e77041d5f1360f1d1ccdc52b86306 (diff) |
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__) {} \ |