From 775defac307e7a82a39ad7279fc9eb245853f063 Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Tue, 19 Nov 2024 14:55:14 -0600 Subject: 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 --- include/rune/util/util.h | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.2.3