24 #ifndef __CLANG_STDATOMIC_H
25 #define __CLANG_STDATOMIC_H
30 #if __STDC_HOSTED__ && __has_include_next(<stdatomic.h>)
31 # include_next <stdatomic.h>
43 #define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE
44 #define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE
45 #define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE
46 #define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE
47 #define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE
48 #define ATOMIC_SHORT_T_LOCK_FREE __GCC_ATOMIC_SHORT_T_LOCK_FREE
49 #define ATOMIC_INT_T_LOCK_FREE __GCC_ATOMIC_INT_T_LOCK_FREE
50 #define ATOMIC_LONG_T_LOCK_FREE __GCC_ATOMIC_LONG_T_LOCK_FREE
51 #define ATOMIC_LLONG_T_LOCK_FREE __GCC_ATOMIC_LLONG_T_LOCK_FREE
52 #define ATOMIC_POINTER_T_LOCK_FREE __GCC_ATOMIC_POINTER_T_LOCK_FREE
56 #define ATOMIC_VAR_INIT(value) (value)
57 #define atomic_init __c11_atomic_init
70 #define kill_dependency(y) (y)
78 #define atomic_thread_fence(order) __c11_atomic_thread_fence(order)
79 #define atomic_signal_fence(order) __c11_atomic_signal_fence(order)
83 #define atomic_is_lock_free(obj) __c11_atomic_is_lock_free(sizeof(*(obj)))
88 typedef _Atomic(
bool) atomic_bool;
90 typedef _Atomic(_Bool) atomic_bool;
92 typedef _Atomic(
char) atomic_char;
93 typedef
_Atomic(
signed char) atomic_schar;
94 typedef
_Atomic(
unsigned char) atomic_uchar;
95 typedef
_Atomic(
short) atomic_short;
96 typedef
_Atomic(
unsigned short) atomic_ushort;
97 typedef
_Atomic(
int) atomic_int;
98 typedef
_Atomic(
unsigned int) atomic_uint;
99 typedef
_Atomic(
long) atomic_long;
100 typedef
_Atomic(
unsigned long) atomic_ulong;
101 typedef
_Atomic(
long long) atomic_llong;
102 typedef
_Atomic(
unsigned long long) atomic_ullong;
103 typedef
_Atomic(uint_least16_t) atomic_char16_t;
104 typedef
_Atomic(uint_least32_t) atomic_char32_t;
105 typedef
_Atomic(
wchar_t) atomic_wchar_t;
106 typedef
_Atomic(int_least8_t) atomic_int_least8_t;
107 typedef
_Atomic(uint_least8_t) atomic_uint_least8_t;
108 typedef
_Atomic(int_least16_t) atomic_int_least16_t;
109 typedef
_Atomic(uint_least16_t) atomic_uint_least16_t;
110 typedef
_Atomic(int_least32_t) atomic_int_least32_t;
111 typedef
_Atomic(uint_least32_t) atomic_uint_least32_t;
112 typedef
_Atomic(int_least64_t) atomic_int_least64_t;
113 typedef
_Atomic(uint_least64_t) atomic_uint_least64_t;
114 typedef
_Atomic(int_fast8_t) atomic_int_fast8_t;
115 typedef
_Atomic(uint_fast8_t) atomic_uint_fast8_t;
116 typedef
_Atomic(int_fast16_t) atomic_int_fast16_t;
117 typedef
_Atomic(uint_fast16_t) atomic_uint_fast16_t;
118 typedef
_Atomic(int_fast32_t) atomic_int_fast32_t;
119 typedef
_Atomic(uint_fast32_t) atomic_uint_fast32_t;
120 typedef
_Atomic(int_fast64_t) atomic_int_fast64_t;
121 typedef
_Atomic(uint_fast64_t) atomic_uint_fast64_t;
122 typedef
_Atomic(intptr_t) atomic_intptr_t;
123 typedef
_Atomic(uintptr_t) atomic_uintptr_t;
124 typedef
_Atomic(
size_t) atomic_size_t;
131 #define atomic_store(object, desired) __c11_atomic_store(object, desired, __ATOMIC_SEQ_CST)
132 #define atomic_store_explicit __c11_atomic_store
134 #define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST)
135 #define atomic_load_explicit __c11_atomic_load
137 #define atomic_exchange(object, desired) __c11_atomic_exchange(object, desired, __ATOMIC_SEQ_CST)
138 #define atomic_exchange_explicit __c11_atomic_exchange
140 #define atomic_compare_exchange_strong(object, expected, desired) __c11_atomic_compare_exchange_strong(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
141 #define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong
143 #define atomic_compare_exchange_weak(object, expected, desired) __c11_atomic_compare_exchange_weak(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
144 #define atomic_compare_exchange_weak_explicit __c11_atomic_compare_exchange_weak
146 #define atomic_fetch_add(object, operand) __c11_atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST)
147 #define atomic_fetch_add_explicit __c11_atomic_fetch_add
149 #define atomic_fetch_sub(object, operand) __c11_atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST)
150 #define atomic_fetch_sub_explicit __c11_atomic_fetch_sub
152 #define atomic_fetch_or(object, operand) __c11_atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST)
153 #define atomic_fetch_or_explicit __c11_atomic_fetch_or
155 #define atomic_fetch_xor(object, operand) __c11_atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST)
156 #define atomic_fetch_xor_explicit __c11_atomic_fetch_xor
158 #define atomic_fetch_and(object, operand) __c11_atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST)
159 #define atomic_fetch_and_explicit __c11_atomic_fetch_and
165 #define ATOMIC_FLAG_INIT { 0 }
178 #define atomic_flag_test_and_set(object) __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST)
179 #define atomic_flag_test_and_set_explicit(object, order) __c11_atomic_exchange(&(object)->_Value, 1, order)
181 #define atomic_flag_clear(object) __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST)
182 #define atomic_flag_clear_explicit(object, order) __c11_atomic_store(&(object)->_Value, 0, order)
Definition: stdatomic.h:62
#define atomic_thread_fence(order)
Definition: stdatomic.h:78
#define atomic_flag_clear(object)
Definition: stdatomic.h:181
Definition: stdatomic.h:65
memory_order
Definition: stdatomic.h:61
#define atomic_flag_clear_explicit(object, order)
Definition: stdatomic.h:182
#define atomic_signal_fence(order)
Definition: stdatomic.h:79
#define atomic_flag_test_and_set_explicit(object, order)
Definition: stdatomic.h:179
Definition: stdatomic.h:163
__INTMAX_TYPE__ intmax_t
Definition: stdint.h:276
Definition: stdatomic.h:64
Definition: stdatomic.h:63
__UINTMAX_TYPE__ uintmax_t
Definition: stdint.h:277
struct atomic_flag atomic_flag
typedef _Atomic(_Bool) atomic_bool
Definition: stdatomic.h:67
__PTRDIFF_TYPE__ ptrdiff_t
Definition: stddef.h:51
Definition: stdatomic.h:66
#define atomic_flag_test_and_set(object)
Definition: stdatomic.h:178
atomic_bool _Value
Definition: stdatomic.h:163