diff options
| author | hachem <im@hachem.wtf> | 2026-08-27 09:05:17 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-08-27 09:05:17 +0200 |
| commit | 4b64b2bd17433f427197af3679c9c8f5ad5ad1a4 (patch) | |
| tree | 7c22cd4fd1d4d3d1d69a8b992adae3e5e6f9e898 /src/core/assert.h | |
| parent | bbe77bbbfbac0043a29d76817af0991996033f93 (diff) | |
add: application run loop + logging
Diffstat (limited to 'src/core/assert.h')
| -rw-r--r-- | src/core/assert.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/core/assert.h b/src/core/assert.h new file mode 100644 index 0000000..eee1c96 --- /dev/null +++ b/src/core/assert.h @@ -0,0 +1,20 @@ +#pragma once + +#include "core/log.h" + +#include <exception> + +#ifdef HSDBG_DIST + #define HSDBG_ASSERT(condition, message) ((void)0) +#else + #define HSDBG_ASSERT(condition, message) \ + do \ + { \ + if (!(condition)) \ + { \ + ::Hsdbg::Log::error("assertion failed: {}", #condition); \ + ::Hsdbg::Log::error(" {}:{}: {}", __FILE__, __LINE__, message); \ + std::terminate(); \ + } \ + } while (false) +#endif |
