39
39
* and alignment purposes.
40
40
*/
41
41
42
- #if ZEND_WIN32 || HAVE_SYNC_ATOMICS
42
+ #if defined( ZEND_WIN32 ) || defined( HAVE_SYNC_ATOMICS )
43
43
typedef struct zend_atomic_bool_s {
44
44
volatile char value ;
45
45
} zend_atomic_bool ;
46
- #elif HAVE_C11_ATOMICS
46
+ #elif defined( HAVE_C11_ATOMICS )
47
47
typedef struct zend_atomic_bool_s {
48
48
_Atomic (bool ) value ;
49
49
} zend_atomic_bool ;
@@ -55,7 +55,7 @@ typedef struct zend_atomic_bool_s {
55
55
56
56
BEGIN_EXTERN_C ()
57
57
58
- #if ZEND_WIN32
58
+ #ifdef ZEND_WIN32
59
59
60
60
#ifndef InterlockedExchange8
61
61
#define InterlockedExchange8 _InterlockedExchange8
@@ -80,7 +80,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
80
80
(void )InterlockedExchange8 (& obj -> value , desired );
81
81
}
82
82
83
- #elif HAVE_C11_ATOMICS
83
+ #elif defined( HAVE_C11_ATOMICS )
84
84
85
85
#define ZEND_ATOMIC_BOOL_INIT (obj , desired ) __c11_atomic_init(&(obj)->value, (desired))
86
86
@@ -96,7 +96,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
96
96
__c11_atomic_store (& obj -> value , desired , __ATOMIC_SEQ_CST );
97
97
}
98
98
99
- #elif HAVE_GNUC_ATOMICS
99
+ #elif defined( HAVE_GNUC_ATOMICS )
100
100
101
101
#define ZEND_ATOMIC_BOOL_INIT (obj , desired ) ((obj)->value = (desired))
102
102
@@ -116,7 +116,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
116
116
__atomic_store (& obj -> value , & desired , __ATOMIC_SEQ_CST );
117
117
}
118
118
119
- #elif HAVE_SYNC_ATOMICS
119
+ #elif defined( HAVE_SYNC_ATOMICS )
120
120
121
121
#define ZEND_ATOMIC_BOOL_INIT (obj , desired ) ((obj)->value = (desired))
122
122
@@ -141,7 +141,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
141
141
__sync_synchronize ();
142
142
}
143
143
144
- #elif HAVE_NO_ATOMICS
144
+ #elif defined( HAVE_NO_ATOMICS )
145
145
146
146
#warning No atomics support detected. Please open an issue with platform details.
147
147
@@ -167,7 +167,7 @@ ZEND_API void zend_atomic_bool_init(zend_atomic_bool *obj, bool desired);
167
167
ZEND_API bool zend_atomic_bool_exchange (zend_atomic_bool * obj , bool desired );
168
168
ZEND_API void zend_atomic_bool_store (zend_atomic_bool * obj , bool desired );
169
169
170
- #if ZEND_WIN32 || HAVE_SYNC_ATOMICS
170
+ #if defined( ZEND_WIN32 ) || defined( HAVE_SYNC_ATOMICS )
171
171
/* On these platforms it is non-const due to underlying APIs. */
172
172
ZEND_API bool zend_atomic_bool_load (zend_atomic_bool * obj );
173
173
#else
0 commit comments