diff options
author | Danny Holman <dholman@gymli.org> | 2024-11-19 14:55:14 -0600 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-11-19 14:55:14 -0600 |
commit | 775defac307e7a82a39ad7279fc9eb245853f063 (patch) | |
tree | 5dbc8e2bd3ca5913c94da4e49dc4c3993f27fa8c | |
parent | b88af607547a79816726adb39acc5afedf978dd6 (diff) |
util: add a NORET macro
Add a NORET macro that expands out to either an attribute flag in the
case of GCC/Clang, or to a declspec on Windows.
Signed-off-by: Danny Holman <dholman@gymli.org>
-rw-r--r-- | include/rune/util/util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/rune/util/util.h b/include/rune/util/util.h index 1ba6781..386f708 100644 --- a/include/rune/util/util.h +++ b/include/rune/util/util.h @@ -38,6 +38,13 @@ #define GLFW_DLL 1 #endif +#ifdef _WIN32 + #define NORET __declspec(noreturn) +#else + #define NORET __attribute__((noreturn)) +#endif + + /// Make API functions visible outside of the library #ifdef RAPI_EXPORT #ifdef _WIN32 |