summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Štetiar2019-11-20 17:02:39 +0000
committerPetr Štetiar2019-11-24 12:26:58 +0000
commit8baeeea1f52d7081aac81d80fdb55b8749d9392e (patch)
tree7b0322e740d0b793d366ab87cafde762d8fa5919
parentb0a5cd8a28bf1d1883317ceac6cb8967d840d6ae (diff)
downloadlibubox-8baeeea1f52d7081aac81d80fdb55b8749d9392e.tar.gz
add assert.h component
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>
-rw-r--r--assert.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/assert.h b/assert.h
new file mode 100644
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