aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--common.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/common.h b/common.h
index 6566fd0..2252215 100644
--- a/common.h
+++ b/common.h
@@ -6,6 +6,7 @@
#include <alloca.h>
#include <math.h>
#include <stddef.h>
+#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
@@ -30,4 +31,16 @@ struct libglitter_render_context {
};
+#ifdef TEST
+
+# define ASSERT(ASSERTION)\
+ do {\
+ if (!(ASSERTION)) {\
+ fprintf(stderr, "Failed assertion at line %i: %s\n", __LINE__, #ASSERTION);\
+ exit(1);\
+ }\
+ } while (0)
+
+#endif
+
#endif