From 74591bf4b7e5f2fac8b3334fe8a54700eef422e6 Mon Sep 17 00:00:00 2001 From: Saki Takamachi Date: Thu, 9 May 2024 22:41:18 +0900 Subject: [PATCH 1/2] Swap the checking order of __has_builtin and __GNUC__ --- ext/hash/murmur/endianness.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/hash/murmur/endianness.h b/ext/hash/murmur/endianness.h index cbad6dc72fb10..11f35a402be3e 100644 --- a/ext/hash/murmur/endianness.h +++ b/ext/hash/murmur/endianness.h @@ -13,14 +13,7 @@ FORCE_INLINE int IsBigEndian(void) # define BSWAP32(u) _byteswap_ulong(u) # define BSWAP64(u) _byteswap_uint64(u) #else -# ifdef __has_builtin -# if __has_builtin(__builtin_bswap32) -# define BSWAP32(u) __builtin_bswap32(u) -# endif // __has_builtin(__builtin_bswap32) -# if __has_builtin(__builtin_bswap64) -# define BSWAP64(u) __builtin_bswap64(u) -# endif // __has_builtin(__builtin_bswap64) -# elif defined(__GNUC__) && ( \ +# if defined(__GNUC__) && ( \ __GNUC__ > 4 || ( \ __GNUC__ == 4 && ( \ __GNUC_MINOR__ >= 3 \ @@ -29,6 +22,13 @@ FORCE_INLINE int IsBigEndian(void) ) # define BSWAP32(u) __builtin_bswap32(u) # define BSWAP64(u) __builtin_bswap64(u) +# elif defined(__has_builtin) +# if __has_builtin(__builtin_bswap32) +# define BSWAP32(u) __builtin_bswap32(u) +# endif // __has_builtin(__builtin_bswap32) +# if __has_builtin(__builtin_bswap64) +# define BSWAP64(u) __builtin_bswap64(u) +# endif // __has_builtin(__builtin_bswap64) # endif // __has_builtin #endif // defined(_MSC_VER) From 7017efe24c2455504228d38545762c2f73bb44ef Mon Sep 17 00:00:00 2001 From: Saki Takamachi Date: Fri, 10 May 2024 09:25:35 +0900 Subject: [PATCH 2/2] [skip ci] NEWS ext/hash: Swap the checking order of __has_builtin and __GNUC__ --- NEWS | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS b/NEWS index 570a1b7ad6759..003a5af37f734 100644 --- a/NEWS +++ b/NEWS @@ -13,6 +13,10 @@ PHP NEWS . Fix crash when calling childNodes next() when iterator is exhausted. (nielsdos) +- Hash: + . ext/hash: Swap the checking order of `__has_builtin` and `__GNUC__` + (Saki Takamachi) + 09 May 2024, PHP 8.2.19 - Core: