Skip to content

Commit ccdbbdc

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2: ext/hash: Swap the checking order of __has_builtin and __GNUC__ (#14185)
2 parents 402f3a9 + 12dc519 commit ccdbbdc

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ PHP NEWS
1717
. Fix crash when calling childNodes next() when iterator is exhausted.
1818
(nielsdos)
1919

20+
- Hash:
21+
. ext/hash: Swap the checking order of `__has_builtin` and `__GNUC__`
22+
(Saki Takamachi)
23+
2024
- Opcache:
2125
. Fixed bug GH-14109 (Fix accidental persisting of internal class constant in
2226
shm). (ilutov)

ext/hash/murmur/endianness.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,7 @@ FORCE_INLINE int IsBigEndian(void)
1313
# define BSWAP32(u) _byteswap_ulong(u)
1414
# define BSWAP64(u) _byteswap_uint64(u)
1515
#else
16-
# ifdef __has_builtin
17-
# if __has_builtin(__builtin_bswap32)
18-
# define BSWAP32(u) __builtin_bswap32(u)
19-
# endif // __has_builtin(__builtin_bswap32)
20-
# if __has_builtin(__builtin_bswap64)
21-
# define BSWAP64(u) __builtin_bswap64(u)
22-
# endif // __has_builtin(__builtin_bswap64)
23-
# elif defined(__GNUC__) && ( \
16+
# if defined(__GNUC__) && ( \
2417
__GNUC__ > 4 || ( \
2518
__GNUC__ == 4 && ( \
2619
__GNUC_MINOR__ >= 3 \
@@ -29,6 +22,13 @@ FORCE_INLINE int IsBigEndian(void)
2922
)
3023
# define BSWAP32(u) __builtin_bswap32(u)
3124
# define BSWAP64(u) __builtin_bswap64(u)
25+
# elif defined(__has_builtin)
26+
# if __has_builtin(__builtin_bswap32)
27+
# define BSWAP32(u) __builtin_bswap32(u)
28+
# endif // __has_builtin(__builtin_bswap32)
29+
# if __has_builtin(__builtin_bswap64)
30+
# define BSWAP64(u) __builtin_bswap64(u)
31+
# endif // __has_builtin(__builtin_bswap64)
3232
# endif // __has_builtin
3333
#endif // defined(_MSC_VER)
3434

0 commit comments

Comments
 (0)