add assert.h component
authorPetr Štetiar <ynezz@true.cz>
Wed, 20 Nov 2019 17:02:39 +0000 (18:02 +0100)
committerPetr Štetiar <ynezz@true.cz>
Sun, 24 Nov 2019 12:26:58 +0000 (13:26 +0100)
In order to allow seamless assert() usage in release builds without the
need for fiddling with CMake C flags as CMake adds -DNDEBUG switch in
release builds which disable assert().

Signed-off-by: Petr Štetiar <ynezz@true.cz>
assert.h [new file with mode: 0644]

diff --git a/assert.h b/assert.h
new file mode 100644 (file)
index 0000000..84f5471
--- /dev/null
+++ b/assert.h
@@ -0,0 +1,9 @@
+#pragma once
+
+#ifdef NDEBUG
+#undef NDEBUG
+#include <assert.h>
+#define NDEBUG
+#else
+#include <assert.h>
+#endif