From 553321501963776c104616cded4d08d1346f7c87 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 27 Sep 2021 10:32:23 -0700 Subject: [PATCH] Use `SDL_NORETURN` I misread SDL's code and thought that SDL's `begin_code.h` was internal only to SDL. It turns out you get it when you include basically any header, such as `SDL_stdinc.h`. So use it directly instead of copying it for our own. --- desktop_version/src/Exit.h | 10 ++-------- desktop_version/src/main.cpp | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/desktop_version/src/Exit.h b/desktop_version/src/Exit.h index 9f058ab3..a80a3a0d 100644 --- a/desktop_version/src/Exit.h +++ b/desktop_version/src/Exit.h @@ -1,14 +1,8 @@ #ifndef VVV_EXIT_H #define VVV_EXIT_H -#ifdef __GNUC__ -# define VVV_NORETURN __attribute__((noreturn)) -#elif defined(_MSC_VER) -# define VVV_NORETURN __declspec(noreturn) -#else -# define VVV_NORETURN -#endif +#include -VVV_NORETURN void VVV_exit(const int exit_code); +SDL_NORETURN void VVV_exit(const int exit_code); #endif /* VVV_EXIT_H */ diff --git a/desktop_version/src/main.cpp b/desktop_version/src/main.cpp index eecaf94a..52c6e599 100644 --- a/desktop_version/src/main.cpp +++ b/desktop_version/src/main.cpp @@ -708,7 +708,7 @@ static void cleanup(void) FILESYSTEM_deinit(); } -VVV_NORETURN void VVV_exit(const int exit_code) +SDL_NORETURN void VVV_exit(const int exit_code) { cleanup(); exit(exit_code);