openMSX
unreachable.hh
Go to the documentation of this file.
1#ifndef UNREACHABLE_HH
2#define UNREACHABLE_HH
3
4#include <utility>
5
6#if defined(NDEBUG)
7 #define UNREACHABLE std::unreachable()
8
9#else
10 // asserts enabled
11 // One some platforms, like MinGW, the compiler cannot determine that
12 // assert(false) will never return, so we help it by wrapping the assert
13 // in an infinite loop.
14 #include <cassert>
15 #define UNREACHABLE while (1) assert(false)
16
17#endif
18
19#endif // UNREACHABLE_HH