]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix NORETURN when GCC minor version is 0
authorThomas Huth <huth@tuxfamily.org>
Mon, 23 Apr 2018 17:40:51 +0000 (19:40 +0200)
committerThomas Huth <huth@tuxfamily.org>
Mon, 21 May 2018 03:36:37 +0000 (05:36 +0200)
The check currently tests if major > 2 && minor >= 1 (since the wanted
attribute functions were likely available since GCC 3.1). That of course
failing if a newer x.0 release of the compiler is used, like GCC 8.0.
So let's fix the check to handle all newer compiler versions correctly.

include/sysdeps.h

index 3c276c4a5d2e893c5964705579487fc8355adca0..8a6e65376b28de379ebcbc05289f9adf4537f0c1 100644 (file)
@@ -477,7 +477,7 @@ extern bool use_long_double;
 #endif
 
 #ifndef STATIC_INLINE
-#if __GNUC__ - 1 > 1 && __GNUC_MINOR__ - 1 >= 0
+#if __GNUC__ - 1 > 2 || (__GNUC__ - 1 == 2 && __GNUC_MINOR__ - 1 >= 0)
 #define STATIC_INLINE static __inline__ __attribute__ ((always_inline))
 #define NOINLINE __attribute__ ((noinline))
 #define NORETURN __attribute__ ((noreturn))