Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit88bcdf9

Browse files
committed
Fix atomic ops for x86 gcc compilers that don't understand atomic intrinsics.
Per buildfarm animal locust.
1 parentb64d92f commit88bcdf9

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎src/include/port/atomics/generic-gcc.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff 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+
#ifdefPG_HAVE_ATOMIC_FLAG_SUPPORT
112+
113+
#if defined(HAVE_GCC__SYNC_CHAR_TAS)|| defined(HAVE_GCC__SYNC_INT32_TAS)
114+
115+
#ifndefPG_HAVE_ATOMIC_TEST_SET_FLAG
113116
#definePG_HAVE_ATOMIC_TEST_SET_FLAG
114117
staticinlinebool
115118
pg_atomic_test_set_flag_impl(volatilepg_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
#ifndefPG_HAVE_ATOMIC_UNLOCKED_TEST_FLAG
124129
#definePG_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
#definePG_HAVE_ATOMIC_COMPARE_EXCHANGE_U32

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp