From 16afec529705ebe2704cb0a85699797bf971827d Mon Sep 17 00:00:00 2001 From: hachem Date: Mon, 7 Oct 2024 09:05:17 +0200 Subject: feat: application run loop and logging --- src/core/assert.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/core/assert.h (limited to 'src/core/assert.h') 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 + +#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 -- cgit v1.3