aboutsummaryrefslogtreecommitdiff
path: root/src/core/assert.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-08-27 09:05:17 +0200
committerhachem <im@hachem.wtf>2026-08-27 09:05:17 +0200
commit4b64b2bd17433f427197af3679c9c8f5ad5ad1a4 (patch)
tree7c22cd4fd1d4d3d1d69a8b992adae3e5e6f9e898 /src/core/assert.h
parentbbe77bbbfbac0043a29d76817af0991996033f93 (diff)
add: application run loop + logging
Diffstat (limited to 'src/core/assert.h')
-rw-r--r--src/core/assert.h20
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