From ab32d51871248e0fbf6758a425eda2256712d519 Mon Sep 17 00:00:00 2001 From: citrons Date: Wed, 11 Oct 2023 23:58:12 -0500 Subject: initial commit --- die.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 die.h (limited to 'die.h') 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 + +#include + +#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)) -- cgit v1.2.3