mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 10:09:43 +01:00
aa2cf3ab4b
I think this is because if you both check that __has_builtin is defined and use it in the same 'if' preprocessor statement, it can error because there's no equivalent to short-circuiting in preprocessor statements. _SDL_HAS_BUILTIN should be safer.
17 lines
428 B
C
17 lines
428 B
C
#ifndef UNREACHABLE_H
|
|
#define UNREACHABLE_H
|
|
|
|
#include <SDL_stdinc.h>
|
|
|
|
SDL_NORETURN SDL_INLINE void VVV_unreachable(void)
|
|
{
|
|
/* __builtin_unreachable() and __assume(0) execute undefined behavior.
|
|
* Otherwise, a noreturn function returning is also undefined behavior. */
|
|
#if _SDL_HAS_BUILTIN(__builtin_unreachable)
|
|
__builtin_unreachable();
|
|
#elif defined(_MSC_VER)
|
|
__assume(0);
|
|
#endif
|
|
}
|
|
|
|
#endif /* UNREACHABLE_H */
|