Vcsn  2.0
Be Rational
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
builtins.hh
Go to the documentation of this file.
1 #ifndef VCSN_MISC_BUILTINS_HH
2 # define VCSN_MISC_BUILTINS_HH
3 
4 # if defined __clang__ || defined __GNUC__
5 
6 # define BUILTIN_UNREACHABLE() __builtin_unreachable()
7 
8 # elif defined _MSC_VER
9 
10 # define BUILTIN_UNREACHABLE() __assume(0)
11 
12 # else
13 
14 # define BUILTIN_UNREACHABLE() \
15  do { \
16  assert(!"unreachable code"); \
17  abort(); \
18  } while (false)
19 
20 # endif
21 
22 #endif // !VCSN_MISC_BUILTINS_HH