From bfde97e001cac6d787c92149426f99821a4c69f0 Mon Sep 17 00:00:00 2001 From: Tomasz Konojacki Date: Mon, 6 Apr 2020 13:04:05 +0200 Subject: [PATCH] don't disable __attribute__((always_inline)) on clang clang pretends to be gcc 4.2 --- perl.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/perl.h b/perl.h index 563edd6..bd92bfc 100644 --- a/perl.h +++ b/perl.h @@ -294,6 +294,11 @@ : (REGEXP *)NULL) #endif +/* some compilers impersonate gcc */ +#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) +# define PERL_IS_GCC 1 +#endif + /* In case Configure was not used (we are using a "canned config" * such as Win32, or a cross-compilation setup, for example) try going * by the gcc major and minor versions. One useful URL is @@ -373,7 +378,7 @@ #endif #ifdef HASATTRIBUTE_ALWAYS_INLINE /* always_inline is buggy in gcc <= 4.6 and causes compilation errors */ -# if __GNUC__ == 4 && __GNUC_MINOR__ >= 7 || __GNUC__ > 4 +# if !defined(PERL_IS_GCC) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7 || __GNUC__ > 4) # define __attribute__always_inline__ __attribute__((always_inline)) # endif #endif -- 1.8.3.1