summaryrefslogtreecommitdiff
path: root/die.h
diff options
context:
space:
mode:
Diffstat (limited to 'die.h')
-rw-r--r--die.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/die.h b/die.h
new file mode 100644
index 0000000..5048ced
--- /dev/null
+++ b/die.h
@@ -0,0 +1,13 @@
+#include <SDL.h>
+
+#include <stdlib.h>
+
+#define die(...) (SDL_Log(__VA_ARGS__), abort())
+static inline void sdl_error_assert(SDL_bool condition) {
+ if (!condition) {
+ SDL_Log("%s", SDL_GetError());
+ // banish to hell forever
+ abort();
+ }
+}
+#define sdl_error_assert(c) (sdl_error_assert(c && SDL_TRUE))