util/compat: include assert(0) in UNREACHABLE macro

Stop overriding it in log.h
This commit is contained in:
Andrei Alexeyev 2023-03-26 03:14:07 +02:00
parent 6c30decd8e
commit 15bdbc496b
No known key found for this signature in database
GPG key ID: 72D26128040B9690
2 changed files with 4 additions and 3 deletions

View file

@ -138,8 +138,6 @@ void log_remove_filters(void);
#if defined(DEBUG) && !defined(__EMSCRIPTEN__)
#define log_debug(...) log_custom(LOG_DEBUG, __VA_ARGS__)
#undef UNREACHABLE
#define UNREACHABLE log_fatal("This code should never be reached (%s:%i)", _TAISEI_SRC_FILE, __LINE__)
#else
#define log_debug(...) ((void)0)
// #define LOG_NO_FILENAMES

View file

@ -80,7 +80,10 @@
#endif
#define PRAGMA(p) _Pragma(#p)
#define UNREACHABLE __builtin_unreachable()
#define UNREACHABLE ({ \
assert(0, "This code should never be reachable"); \
__builtin_unreachable(); \
})
#define DIAGNOSTIC(x) PRAGMA(GCC diagnostic x)
#if defined(__clang__)