|
39 | 39 | * and alignment purposes. |
40 | 40 | */ |
41 | 41 |
|
42 | | -#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) |
| 42 | +#if (defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS)) && !defined(HAVE_C11_ATOMICS) |
43 | 43 | typedef struct zend_atomic_bool_s { |
44 | 44 | volatile char value; |
45 | 45 | } zend_atomic_bool; |
@@ -68,7 +68,7 @@ typedef struct zend_atomic_int_s { |
68 | 68 |
|
69 | 69 | BEGIN_EXTERN_C() |
70 | 70 |
|
71 | | -#ifdef ZEND_WIN32 |
| 71 | +#if defined(ZEND_WIN32) && !defined(HAVE_C11_ATOMICS) |
72 | 72 |
|
73 | 73 | #ifndef InterlockedExchange8 |
74 | 74 | #define InterlockedExchange8 _InterlockedExchange8 |
@@ -123,7 +123,7 @@ static zend_always_inline bool zend_atomic_int_compare_exchange_ex(zend_atomic_i |
123 | 123 | } |
124 | 124 | } |
125 | 125 |
|
126 | | -/* On this platform it is non-const due to Iterlocked API*/ |
| 126 | +/* On this platform it is non-const due to Interlocked API */ |
127 | 127 | static zend_always_inline bool zend_atomic_bool_load_ex(zend_atomic_bool *obj) { |
128 | 128 | /* Or'ing with false won't change the value. */ |
129 | 129 | return InterlockedOr8(&obj->value, false); |
@@ -376,7 +376,7 @@ ZEND_API bool zend_atomic_int_compare_exchange(zend_atomic_int *obj, int *expect |
376 | 376 | ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj, bool desired); |
377 | 377 | ZEND_API void zend_atomic_int_store(zend_atomic_int *obj, int desired); |
378 | 378 |
|
379 | | -#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS) |
| 379 | +#if (defined(ZEND_WIN32) && !defined(HAVE_C11_ATOMICS)) || defined(HAVE_SYNC_ATOMICS) |
380 | 380 | /* On these platforms it is non-const due to underlying APIs. */ |
381 | 381 | ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj); |
382 | 382 | ZEND_API int zend_atomic_int_load(zend_atomic_int *obj); |
|
0 commit comments