diff options
Diffstat (limited to 'common.h')
-rw-r--r-- | common.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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 |