diff options
| author | citrons <citrons@mondecitronne.com> | 2023-10-11 23:58:12 -0500 |
|---|---|---|
| committer | citrons <citrons@mondecitronne.com> | 2023-10-11 23:58:12 -0500 |
| commit | ab32d51871248e0fbf6758a425eda2256712d519 (patch) | |
| tree | ba48813a3a75f79eea5c867496d77fdb8a3251db /die.h | |
initial commit
Diffstat (limited to 'die.h')
| -rw-r--r-- | die.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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)) |
