Skip to content

Commit ec59a6c

Browse files
committed
Fix build issues
1 parent ad35f1b commit ec59a6c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Zend/zend_atomic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ extern inline ZEND_API bool zend_atomic_bool_exchange(zend_atomic_bool *obj,
3232
extern inline ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj,
3333
bool desired);
3434

35-
#if ZEND_WIN32
36-
/* On this platform it is non-const due to Iterlocked API*/
35+
#if ZEND_WIN32 || HAVE_SYNC_ATOMICS
36+
/* On these platforms it is non-const due to underlying APIs. */
3737
extern inline ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj);
3838
#else
3939
extern inline ZEND_API bool zend_atomic_bool_load(const zend_atomic_bool *obj);

Zend/zend_atomic.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
#define __has_feature(x) 0
2424
#endif
2525

26+
#ifndef __GNUC_PREREQ__
27+
#define __GNUC_PREREQ__(x, y) 0
28+
#endif
29+
2630
/* Builtins are used to avoid library linkage */
2731
#if __has_feature(c_atomic)
2832
#define HAVE_C11_ATOMICS 1
@@ -118,7 +122,7 @@ inline ZEND_API bool zend_atomic_bool_exchange(zend_atomic_bool *obj, bool desir
118122
return prev;
119123
}
120124

121-
inline ZEND_API bool zend_atomic_bool_load(const zend_atomic_bool *obj) {
125+
inline ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj) {
122126
/* Or'ing false won't change the value */
123127
return __sync_fetch_and_or(&obj->value, false);
124128
}

0 commit comments

Comments
 (0)