summaryrefslogtreecommitdiffstats
path: root/lisiblepng/src/assert.h
diff options
context:
space:
mode:
Diffstat (limited to 'lisiblepng/src/assert.h')
-rw-r--r--lisiblepng/src/assert.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/lisiblepng/src/assert.h b/lisiblepng/src/assert.h
new file mode 100644
index 0000000..7d41b57
--- /dev/null
+++ b/lisiblepng/src/assert.h
@@ -0,0 +1,15 @@
+#ifndef LISIBLE_PNG_ASSET_H
+#define LISIBLE_PNG_ASSET_H
+
+#include "log.h"
+
+#define ASSERT(predicate) \
+ do { \
+ if (!(predicate)) { \
+ LOGN("Assertion failed in %s:%d:\n\t%s", __FILE__, __LINE__, \
+ #predicate); \
+ exit(1); \
+ } \
+ } while (0)
+
+#endif // LISIBLE_PNG_ASSET_H
Go back to lisible.xyz