Skip to content

Commit 6248424

Browse files
committed
Try fixing GCC version detection
1 parent 80e487a commit 6248424

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Zend/zend_atomic.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,22 @@
2323
#define __has_feature(x) 0
2424
#endif
2525

26-
#ifndef __GNUC_PREREQ__
27-
#define __GNUC_PREREQ__(x, y) 0
28-
#endif
26+
#define ZEND_GCC_PREREQ(x, y) \
27+
((__GNUC__ == (x) && __GNUC_MINOR__ >= (y)) || (__GNUC__ > (x)))
2928

3029
/* Builtins are used to avoid library linkage */
3130
#if __has_feature(c_atomic)
3231
#define HAVE_C11_ATOMICS 1
33-
#elif __GNUC_PREREQ__(4, 7)
32+
#elif ZEND_GCC_PREREQ(4, 7)
3433
#define HAVE_GNUC_ATOMICS 1
3534
#elif defined(__GNUC__)
3635
#define HAVE_SYNC_ATOMICS 1
3736
#elif !defined(ZEND_WIN32)
3837
#define HAVE_NO_ATOMICS 1
3938
#endif
4039

40+
#undef ZEND_GCC_PREREQ
41+
4142
/* Treat zend_atomic_* types as opaque. They have definitions only for size
4243
* and alignment purposes.
4344
*/

0 commit comments

Comments
 (0)