summaryrefslogtreecommitdiff
path: root/die.h
diff options
context:
space:
mode:
Diffstat (limited to 'die.h')
-rw-r--r--die.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/die.h b/die.h
index 5048ced..9639bf1 100644
--- a/die.h
+++ b/die.h
@@ -1,13 +1,12 @@
+#ifndef DIE_H
+#define DIE_H
+
#include <SDL.h>
-#include <stdlib.h>
+void die(void);
+void sdl_error_assert(SDL_bool condition);
-#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 die(...) (SDL_LogCritical(SDL_LOG_CATEGORY_ERROR, __VA_ARGS__), die())
#define sdl_error_assert(c) (sdl_error_assert(c && SDL_TRUE))
+
+#endif