BitStream
assert.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef BS_DEBUG_BREAK
4 #if defined(_WIN32) // Windows
5 #define BS_BREAKPOINT() __debugbreak()
6 #elif defined(__linux__) // Linux
7 #include <csignal>
8 #define BS_BREAKPOINT() std::raise(SIGTRAP)
9 #else // Non-supported
10 #define BS_BREAKPOINT() throw
11 #endif
12 
13 #define BS_ASSERT(x) if (!(x)) { BS_BREAKPOINT(); return false; }
14 #else // BS_DEBUG_BREAK
15 #define BS_ASSERT(x) if (!(x)) { return false; }
16 
17 #define BS_BREAKPOINT() throw
18 #endif // BS_DEBUG_BREAK