summaryrefslogtreecommitdiff
path: root/src/shared/include/assert.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/include/assert.h')
-rw-r--r--src/shared/include/assert.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/include/assert.h b/src/shared/include/assert.h
index 7adf297..7520aa9 100644
--- a/src/shared/include/assert.h
+++ b/src/shared/include/assert.h
@@ -1,3 +1,7 @@
-#pragma once
+#ifdef NDEBUG
+#define assert(stmt) do {} while (0)
+#else
#define assert(stmt) do { if (!(stmt)) __badassert(__func__, __FILE__, __LINE__); } while (0)
+#endif
+
_Noreturn void __badassert(const char *func, const char *file, int line);