From cbaaec98ca14ecb6bc8521b9fb7a9c319cb20f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antonio=20Ni=C3=B1o=20D=C3=ADaz?= Date: Mon, 2 Apr 2018 22:14:24 +0100 Subject: [PATCH] Simplify helpers.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `__attribute__((noreturn))` has been supported since GCC 2.5, that was released October 22, 1993. It doesn't make sense to check if the version is at least that one, we are compiling for C99, that is more modern. [1] Also, remove the MSVC check. This code is never compiled with it so there may be problems that need to be solved to make it compile. All releases cross-compiled from linux. If there is an actual need to support MSVC, the compiler definitions can be added again. Also, if the compiler is not supported, the compiler helpers default to nothing, so the code can still compile. [1] https://gcc.gnu.org/onlinedocs/ Signed-off-by: Antonio Niño Díaz --- include/helpers.h | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/include/helpers.h b/include/helpers.h index 0f471a08..3a3cc476 100644 --- a/include/helpers.h +++ b/include/helpers.h @@ -9,21 +9,10 @@ #ifndef HELPERS_H #define HELPERS_H -#if defined(__GNUC__) - #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ >= 5)) - /* GCC 2.5 or newer */ - #define noreturn __attribute__ ((noreturn)) - #endif -#endif - -#if defined(_MSC_VER) && !defined(noreturn) - #if _MSC_VER >= 1310 - /* MS Visual Studio 2003/.NET Framework 1.1 or newer */ - #define noreturn _declspec(noreturn) - #endif -#endif - -#if !defined(noreturn) +#ifdef __GNUC__ + /* GCC or compatible */ + #define noreturn __attribute__ ((noreturn)) +#else /* Unsupported, but no need to throw a fit */ #define noreturn #endif