summaryrefslogtreecommitdiff
path: root/die.h
diff options
context:
space:
mode:
authorcitrons <citrons@mondecitronne.com>2023-10-12 16:32:32 -0500
committercitrons <citrons@mondecitronne.com>2023-10-12 16:32:32 -0500
commitd1ba7e3713cd999635104591295d1923235c9289 (patch)
treef639da0345b422b2702e4132ca5315669be7d240 /die.h
parent818732592abbf3b2a2c8e3d66cdd056a104bade1 (diff)
make error handling worse
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