summaryrefslogtreecommitdiffhomepage
path: root/compat/unreachable.hpp
blob: bb029b6d5d78963f62b41c5bd4cde4d84db15393 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#pragma once

namespace floormat {

[[noreturn]] inline void unreachable()
{
#if defined __GNUC__
    __builtin_unreachable();
#elif defined _MSC_VER
    __assume(false);
#else
    *(volatile int*)0 = 0;
#endif
}

} // namespace floormat