aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/inc/assert.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/inc/assert.h b/src/lib/inc/assert.h
new file mode 100644
index 0000000..2cb095b
--- /dev/null
+++ b/src/lib/inc/assert.h
@@ -0,0 +1,11 @@
+// MIT License, Copyright (c) 2020 Marvin Borner
+
+#ifndef ASSERT_H
+#define ASSERT_H
+
+#include <print.h>
+
+#define assert(exp) \
+ (exp) ? 0 : printf("%s:%d: %s: Assertion '%s' failed\n", __FILE__, __LINE__, __func__, #exp)
+
+#endif