File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -108,8 +108,11 @@ typedef struct pg_atomic_uint64
108108 */
109109#if defined(PG_USE_INLINE ) || defined(ATOMICS_INCLUDE_DEFINITIONS )
110110
111- #if !defined(PG_HAVE_ATOMIC_TEST_SET_FLAG ) && \
112- (defined(HAVE_GCC__SYNC_CHAR_TAS ) || defined(HAVE_GCC__SYNC_INT32_TAS ))
111+ #ifdef PG_HAVE_ATOMIC_FLAG_SUPPORT
112+
113+ #if defined(HAVE_GCC__SYNC_CHAR_TAS ) || defined(HAVE_GCC__SYNC_INT32_TAS )
114+
115+ #ifndef PG_HAVE_ATOMIC_TEST_SET_FLAG
113116#define PG_HAVE_ATOMIC_TEST_SET_FLAG
114117static inline bool
115118pg_atomic_test_set_flag_impl (volatile pg_atomic_flag * ptr )
@@ -118,7 +121,9 @@ pg_atomic_test_set_flag_impl(volatile pg_atomic_flag *ptr)
118121 /* some platform only support a 1 here */
119122 return __sync_lock_test_and_set (& ptr -> value , 1 ) == 0 ;
120123}
121- #endif /* !defined(PG_HAVE_ATOMIC_TEST_SET_FLAG) && defined(HAVE_GCC__SYNC_*_TAS) */
124+ #endif
125+
126+ #endif /* defined(HAVE_GCC__SYNC_*_TAS) */
122127
123128#ifndef PG_HAVE_ATOMIC_UNLOCKED_TEST_FLAG
124129#define PG_HAVE_ATOMIC_UNLOCKED_TEST_FLAG
@@ -153,6 +158,8 @@ pg_atomic_init_flag_impl(volatile pg_atomic_flag *ptr)
153158}
154159#endif
155160
161+ #endif /* defined(PG_HAVE_ATOMIC_FLAG_SUPPORT) */
162+
156163/* prefer __atomic, it has a better API */
157164#if !defined(PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32 ) && defined(HAVE_GCC__ATOMIC_INT32_CAS )
158165#define PG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32
You can’t perform that action at this time.
0 commit comments