Skip to content

Commit 18cd80c

Browse files
Fixed undefined macros warnings
1 parent fd55b50 commit 18cd80c

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Zend/zend_atomic.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj, bool desired) {
3535
zend_atomic_bool_store_ex(obj, desired);
3636
}
3737

38-
#if ZEND_WIN32 || HAVE_SYNC_ATOMICS
38+
#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS)
3939
/* On these platforms it is non-const due to underlying APIs. */
4040
ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj) {
4141
return zend_atomic_bool_load_ex(obj);

Zend/zend_atomic.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
* and alignment purposes.
4040
*/
4141

42-
#if ZEND_WIN32 || HAVE_SYNC_ATOMICS
42+
#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS)
4343
typedef struct zend_atomic_bool_s {
4444
volatile char value;
4545
} zend_atomic_bool;
46-
#elif HAVE_C11_ATOMICS
46+
#elif defined(HAVE_C11_ATOMICS)
4747
typedef struct zend_atomic_bool_s {
4848
_Atomic(bool) value;
4949
} zend_atomic_bool;
@@ -55,7 +55,7 @@ typedef struct zend_atomic_bool_s {
5555

5656
BEGIN_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);
167167
ZEND_API bool zend_atomic_bool_exchange(zend_atomic_bool *obj, bool desired);
168168
ZEND_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. */
172172
ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj);
173173
#else

0 commit comments

Comments
 (0)