summaryrefslogtreecommitdiff
path: root/libraries/euler/include/cassert
diff options
context:
space:
mode:
authorBenji Dial <benji@benjidial.net>2024-01-20 17:59:40 -0500
committerBenji Dial <benji@benjidial.net>2024-01-20 17:59:40 -0500
commit7199e74aa22e592a3b77bdd81f735edca5470596 (patch)
tree66e935372acc5d6e013f764965f2a9d81814f809 /libraries/euler/include/cassert
parent53135e2592c21cb9b2609bf95242aaf1f19233da (diff)
downloadhilbert-os-7199e74aa22e592a3b77bdd81f735edca5470596.tar.gz
update
Diffstat (limited to 'libraries/euler/include/cassert')
-rw-r--r--libraries/euler/include/cassert13
1 files changed, 13 insertions, 0 deletions
diff --git a/libraries/euler/include/cassert b/libraries/euler/include/cassert
new file mode 100644
index 0000000..bc716a0
--- /dev/null
+++ b/libraries/euler/include/cassert
@@ -0,0 +1,13 @@
+#pragma once
+
+namespace euler {
+ [[noreturn]] void assert_failed(
+ const char *file, const char *function, int line, const char *condition);
+}
+
+#ifdef NDEBUG
+#define assert(condition) ((void)0)
+#else
+#define assert(condition) ((condition) ? ((void)0) : \
+ euler::assert_failed(__FILE__, __func__, __LINE__, #condition))
+#endif