From bf2f33f1ca388c95e62fb3fa74a980f7f29e28cb Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 22 Sep 2021 19:58:31 -0700 Subject: [PATCH] Add noreturn qualifier to `VVV_exit` This function doesn't return, so we mark it as noreturn if the compiler supports it. --- desktop_version/src/Exit.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/Exit.h b/desktop_version/src/Exit.h index f3b9ff62..9f058ab3 100644 --- a/desktop_version/src/Exit.h +++ b/desktop_version/src/Exit.h @@ -1,6 +1,14 @@ #ifndef VVV_EXIT_H #define VVV_EXIT_H -void VVV_exit(const int exit_code); +#ifdef __GNUC__ +# define VVV_NORETURN __attribute__((noreturn)) +#elif defined(_MSC_VER) +# define VVV_NORETURN __declspec(noreturn) +#else +# define VVV_NORETURN +#endif + +VVV_NORETURN void VVV_exit(const int exit_code); #endif /* VVV_EXIT_H */