OXYGENHUB
◆ main openmsx / src / utils / unreachable.hh
424 B · C++ · last changed chore(): initial commit 1 month ago source blame history raw
e8555c89 Andy McCall 1
#ifndef UNREACHABLE_HH
2
#define UNREACHABLE_HH
3
4
#include <utility>
5
6
#ifdef 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