ref: cbaaec98ca14ecb6bc8521b9fb7a9c319cb20f4e
parent: 895d1d581382bfbcf67827318328d6efc1be463f
author: Antonio Niño Díaz <antonio_nd@outlook.com>
date: Mon Apr 2 18:14:24 EDT 2018
Simplify helpers.h `__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 <antonio_nd@outlook.com>
--- 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