@@ -58,10 +58,9 @@ static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *ob
58
58
return InterlockedExchange8 (& obj -> value , desired );
59
59
}
60
60
61
- /* On this platform it is non-const due to Iterlocked API*/
62
- static zend_always_inline bool zend_atomic_bool_load_ex (zend_atomic_bool * obj ) {
61
+ static zend_always_inline bool zend_atomic_bool_load_ex (const zend_atomic_bool * obj ) {
63
62
/* Or'ing with false won't change the value. */
64
- return InterlockedOr8 (& obj -> value , false);
63
+ return InterlockedOr8 (& (( zend_atomic_bool * ) obj ) -> value , false);
65
64
}
66
65
67
66
static zend_always_inline void zend_atomic_bool_store_ex (zend_atomic_bool * obj , bool desired ) {
@@ -118,9 +117,9 @@ static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *ob
118
117
return prev ;
119
118
}
120
119
121
- static zend_always_inline bool zend_atomic_bool_load_ex (zend_atomic_bool * obj ) {
120
+ static zend_always_inline bool zend_atomic_bool_load_ex (const zend_atomic_bool * obj ) {
122
121
/* Or'ing false won't change the value */
123
- return __sync_fetch_and_or (& obj -> value , false);
122
+ return __sync_fetch_and_or (& (( zend_atomic_bool * ) obj ) -> value , false);
124
123
}
125
124
126
125
static zend_always_inline void zend_atomic_bool_store_ex (zend_atomic_bool * obj , bool desired ) {
@@ -154,13 +153,7 @@ static zend_always_inline bool zend_atomic_bool_exchange_ex(zend_atomic_bool *ob
154
153
ZEND_API void zend_atomic_bool_init (zend_atomic_bool * obj , bool desired );
155
154
ZEND_API bool zend_atomic_bool_exchange (zend_atomic_bool * obj , bool desired );
156
155
ZEND_API void zend_atomic_bool_store (zend_atomic_bool * obj , bool desired );
157
-
158
- #if ZEND_WIN32 || HAVE_SYNC_ATOMICS
159
- /* On these platforms it is non-const due to underlying APIs. */
160
- ZEND_API bool zend_atomic_bool_load (zend_atomic_bool * obj );
161
- #else
162
156
ZEND_API bool zend_atomic_bool_load (const zend_atomic_bool * obj );
163
- #endif
164
157
165
158
END_EXTERN_C ()
166
159
0 commit comments