mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fixed undefined macros warnings
This commit is contained in:
parent
fd55b50833
commit
18cd80c327
2 changed files with 9 additions and 9 deletions
|
@ -35,7 +35,7 @@ ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj, bool desired) {
|
||||||
zend_atomic_bool_store_ex(obj, desired);
|
zend_atomic_bool_store_ex(obj, desired);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ZEND_WIN32 || HAVE_SYNC_ATOMICS
|
#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS)
|
||||||
/* On these platforms it is non-const due to underlying APIs. */
|
/* On these platforms it is non-const due to underlying APIs. */
|
||||||
ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj) {
|
ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj) {
|
||||||
return zend_atomic_bool_load_ex(obj);
|
return zend_atomic_bool_load_ex(obj);
|
||||||
|
|
|
@ -39,11 +39,11 @@
|
||||||
* and alignment purposes.
|
* and alignment purposes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if ZEND_WIN32 || HAVE_SYNC_ATOMICS
|
#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS)
|
||||||
typedef struct zend_atomic_bool_s {
|
typedef struct zend_atomic_bool_s {
|
||||||
volatile char value;
|
volatile char value;
|
||||||
} zend_atomic_bool;
|
} zend_atomic_bool;
|
||||||
#elif HAVE_C11_ATOMICS
|
#elif defined(HAVE_C11_ATOMICS)
|
||||||
typedef struct zend_atomic_bool_s {
|
typedef struct zend_atomic_bool_s {
|
||||||
_Atomic(bool) value;
|
_Atomic(bool) value;
|
||||||
} zend_atomic_bool;
|
} zend_atomic_bool;
|
||||||
|
@ -55,7 +55,7 @@ typedef struct zend_atomic_bool_s {
|
||||||
|
|
||||||
BEGIN_EXTERN_C()
|
BEGIN_EXTERN_C()
|
||||||
|
|
||||||
#if ZEND_WIN32
|
#ifdef ZEND_WIN32
|
||||||
|
|
||||||
#ifndef InterlockedExchange8
|
#ifndef InterlockedExchange8
|
||||||
#define InterlockedExchange8 _InterlockedExchange8
|
#define InterlockedExchange8 _InterlockedExchange8
|
||||||
|
@ -80,7 +80,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
|
||||||
(void)InterlockedExchange8(&obj->value, desired);
|
(void)InterlockedExchange8(&obj->value, desired);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif HAVE_C11_ATOMICS
|
#elif defined(HAVE_C11_ATOMICS)
|
||||||
|
|
||||||
#define ZEND_ATOMIC_BOOL_INIT(obj, desired) __c11_atomic_init(&(obj)->value, (desired))
|
#define ZEND_ATOMIC_BOOL_INIT(obj, desired) __c11_atomic_init(&(obj)->value, (desired))
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
|
||||||
__c11_atomic_store(&obj->value, desired, __ATOMIC_SEQ_CST);
|
__c11_atomic_store(&obj->value, desired, __ATOMIC_SEQ_CST);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif HAVE_GNUC_ATOMICS
|
#elif defined(HAVE_GNUC_ATOMICS)
|
||||||
|
|
||||||
#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired))
|
#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired))
|
||||||
|
|
||||||
|
@ -116,7 +116,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
|
||||||
__atomic_store(&obj->value, &desired, __ATOMIC_SEQ_CST);
|
__atomic_store(&obj->value, &desired, __ATOMIC_SEQ_CST);
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif HAVE_SYNC_ATOMICS
|
#elif defined(HAVE_SYNC_ATOMICS)
|
||||||
|
|
||||||
#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired))
|
#define ZEND_ATOMIC_BOOL_INIT(obj, desired) ((obj)->value = (desired))
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ static zend_always_inline void zend_atomic_bool_store_ex(zend_atomic_bool *obj,
|
||||||
__sync_synchronize();
|
__sync_synchronize();
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif HAVE_NO_ATOMICS
|
#elif defined(HAVE_NO_ATOMICS)
|
||||||
|
|
||||||
#warning No atomics support detected. Please open an issue with platform details.
|
#warning No atomics support detected. Please open an issue with platform details.
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ ZEND_API void zend_atomic_bool_init(zend_atomic_bool *obj, bool desired);
|
||||||
ZEND_API bool zend_atomic_bool_exchange(zend_atomic_bool *obj, bool desired);
|
ZEND_API bool zend_atomic_bool_exchange(zend_atomic_bool *obj, bool desired);
|
||||||
ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj, bool desired);
|
ZEND_API void zend_atomic_bool_store(zend_atomic_bool *obj, bool desired);
|
||||||
|
|
||||||
#if ZEND_WIN32 || HAVE_SYNC_ATOMICS
|
#if defined(ZEND_WIN32) || defined(HAVE_SYNC_ATOMICS)
|
||||||
/* On these platforms it is non-const due to underlying APIs. */
|
/* On these platforms it is non-const due to underlying APIs. */
|
||||||
ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj);
|
ZEND_API bool zend_atomic_bool_load(zend_atomic_bool *obj);
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue