3939 * and alignment purposes.
4040 */
4141
42- #if ZEND_WIN32 || HAVE_SYNC_ATOMICS
42+ #if defined( ZEND_WIN32 ) || defined( HAVE_SYNC_ATOMICS )
4343typedef struct zend_atomic_bool_s {
4444 volatile char value ;
4545} zend_atomic_bool ;
46- #elif HAVE_C11_ATOMICS
46+ #elif defined( HAVE_C11_ATOMICS )
4747typedef struct zend_atomic_bool_s {
4848 _Atomic (bool ) value ;
4949} zend_atomic_bool ;
@@ -55,7 +55,7 @@ typedef struct zend_atomic_bool_s {
5555
5656BEGIN_EXTERN_C ()
5757
58- #if ZEND_WIN32
58+ #ifdef ZEND_WIN32
5959
6060#ifndef InterlockedExchange8
6161#define InterlockedExchange8 _InterlockedExchange8
@@ -80,7 +80,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
8080 (void )InterlockedExchange8 (& obj -> value , desired );
8181}
8282
83- #elif HAVE_C11_ATOMICS
83+ #elif defined( HAVE_C11_ATOMICS )
8484
8585#define ZEND_ATOMIC_BOOL_INIT (obj , desired ) __c11_atomic_init(&(obj)->value, (desired))
8686
@@ -96,7 +96,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
9696 __c11_atomic_store (& obj -> value , desired , __ATOMIC_SEQ_CST );
9797}
9898
99- #elif HAVE_GNUC_ATOMICS
99+ #elif defined( HAVE_GNUC_ATOMICS )
100100
101101#define ZEND_ATOMIC_BOOL_INIT (obj , desired ) ((obj)->value = (desired))
102102
@@ -116,7 +116,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
116116 __atomic_store (& obj -> value , & desired , __ATOMIC_SEQ_CST );
117117}
118118
119- #elif HAVE_SYNC_ATOMICS
119+ #elif defined( HAVE_SYNC_ATOMICS )
120120
121121#define ZEND_ATOMIC_BOOL_INIT (obj , desired ) ((obj)->value = (desired))
122122
@@ -141,7 +141,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
141141 __sync_synchronize ();
142142}
143143
144- #elif HAVE_NO_ATOMICS
144+ #elif defined( HAVE_NO_ATOMICS )
145145
146146#warning No atomics support detected. Please open an issue with platform details.
147147
@@ -167,7 +167,7 @@ ZEND_API void zend_atomic_bool_init(zend_atomic_bool *obj, bool desired);
167167ZEND_API bool zend_atomic_bool_exchange (zend_atomic_bool * obj , bool desired );
168168ZEND_API void zend_atomic_bool_store (zend_atomic_bool * obj , bool desired );
169169
170- #if ZEND_WIN32 || HAVE_SYNC_ATOMICS
170+ #if defined( ZEND_WIN32 ) || defined( HAVE_SYNC_ATOMICS )
171171/* On these platforms it is non-const due to underlying APIs. */
172172ZEND_API bool zend_atomic_bool_load (zend_atomic_bool * obj );
173173#else
0 commit comments