diff options
author | Oxore <oxore@protonmail.com> | 2022-09-03 17:33:07 +0300 |
---|---|---|
committer | Oxore <oxore@protonmail.com> | 2022-09-03 17:33:07 +0300 |
commit | d2b615061e008c4d13a6ce0f11efd8ec337f41c6 (patch) | |
tree | 0aab1cc72db576761524267ea3594a21db14b829 /utils.hpp | |
parent | 9037b017d6519fed435eea20c3553d40d871d379 (diff) |
Impl breakpoints (pretty much draft)
Breakpoints work somehow, but overstep 1 instruction. Needs to be fixed.
Diffstat (limited to 'utils.hpp')
-rw-r--r-- | utils.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -3,13 +3,19 @@ #pragma once +#if defined(NDEBUG) #ifdef __clang__ -# define UNREACHABLE __builtin_unreachable +# define UNREACHABLE (__builtin_unreachable()) #elif __GNUC__ -# define UNREACHABLE __builtin_unreachable +# define UNREACHABLE (__builtin_unreachable()) #else # define UNREACHABLE #endif +#else +#include <cassert> +#define UNREACHABLE (assert((void*)0 == "Unreachable code reached"), abort(), 1) +#endif + #include <stdint.h> |