10 #ifndef __CLANG_STDATOMIC_H
11 #define __CLANG_STDATOMIC_H
16 #if __STDC_HOSTED__ && __has_include_next(<stdatomic.h>)
17 # include_next <stdatomic.h>
29 #define ATOMIC_BOOL_LOCK_FREE __CLANG_ATOMIC_BOOL_LOCK_FREE
30 #define ATOMIC_CHAR_LOCK_FREE __CLANG_ATOMIC_CHAR_LOCK_FREE
31 #define ATOMIC_CHAR16_T_LOCK_FREE __CLANG_ATOMIC_CHAR16_T_LOCK_FREE
32 #define ATOMIC_CHAR32_T_LOCK_FREE __CLANG_ATOMIC_CHAR32_T_LOCK_FREE
33 #define ATOMIC_WCHAR_T_LOCK_FREE __CLANG_ATOMIC_WCHAR_T_LOCK_FREE
34 #define ATOMIC_SHORT_LOCK_FREE __CLANG_ATOMIC_SHORT_LOCK_FREE
35 #define ATOMIC_INT_LOCK_FREE __CLANG_ATOMIC_INT_LOCK_FREE
36 #define ATOMIC_LONG_LOCK_FREE __CLANG_ATOMIC_LONG_LOCK_FREE
37 #define ATOMIC_LLONG_LOCK_FREE __CLANG_ATOMIC_LLONG_LOCK_FREE
38 #define ATOMIC_POINTER_LOCK_FREE __CLANG_ATOMIC_POINTER_LOCK_FREE
42 #define ATOMIC_VAR_INIT(value) (value)
43 #define atomic_init __c11_atomic_init
56 #define kill_dependency(y) (y)
64 #define atomic_thread_fence(order) __c11_atomic_thread_fence(order)
65 #define atomic_signal_fence(order) __c11_atomic_signal_fence(order)
69 #define atomic_is_lock_free(obj) __c11_atomic_is_lock_free(sizeof(*(obj)))
74 typedef _Atomic(
bool) atomic_bool;
79 typedef _Atomic(
signed char) atomic_schar;
80 typedef _Atomic(
unsigned char) atomic_uchar;
82 typedef _Atomic(
unsigned short) atomic_ushort;
84 typedef _Atomic(
unsigned int) atomic_uint;
86 typedef _Atomic(
unsigned long) atomic_ulong;
88 typedef _Atomic(
unsigned long long) atomic_ullong;
89 typedef _Atomic(uint_least16_t) atomic_char16_t;
90 typedef _Atomic(uint_least32_t) atomic_char32_t;
92 typedef _Atomic(int_least8_t) atomic_int_least8_t;
93 typedef _Atomic(uint_least8_t) atomic_uint_least8_t;
94 typedef _Atomic(int_least16_t) atomic_int_least16_t;
95 typedef _Atomic(uint_least16_t) atomic_uint_least16_t;
96 typedef _Atomic(int_least32_t) atomic_int_least32_t;
97 typedef _Atomic(uint_least32_t) atomic_uint_least32_t;
98 typedef _Atomic(int_least64_t) atomic_int_least64_t;
99 typedef _Atomic(uint_least64_t) atomic_uint_least64_t;
100 typedef _Atomic(int_fast8_t) atomic_int_fast8_t;
101 typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t;
102 typedef _Atomic(int_fast16_t) atomic_int_fast16_t;
103 typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t;
104 typedef _Atomic(int_fast32_t) atomic_int_fast32_t;
105 typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t;
106 typedef _Atomic(int_fast64_t) atomic_int_fast64_t;
107 typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t;
117 #define atomic_store(object, desired) __c11_atomic_store(object, desired, __ATOMIC_SEQ_CST)
118 #define atomic_store_explicit __c11_atomic_store
120 #define atomic_load(object) __c11_atomic_load(object, __ATOMIC_SEQ_CST)
121 #define atomic_load_explicit __c11_atomic_load
123 #define atomic_exchange(object, desired) __c11_atomic_exchange(object, desired, __ATOMIC_SEQ_CST)
124 #define atomic_exchange_explicit __c11_atomic_exchange
126 #define atomic_compare_exchange_strong(object, expected, desired) __c11_atomic_compare_exchange_strong(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
127 #define atomic_compare_exchange_strong_explicit __c11_atomic_compare_exchange_strong
129 #define atomic_compare_exchange_weak(object, expected, desired) __c11_atomic_compare_exchange_weak(object, expected, desired, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)
130 #define atomic_compare_exchange_weak_explicit __c11_atomic_compare_exchange_weak
132 #define atomic_fetch_add(object, operand) __c11_atomic_fetch_add(object, operand, __ATOMIC_SEQ_CST)
133 #define atomic_fetch_add_explicit __c11_atomic_fetch_add
135 #define atomic_fetch_sub(object, operand) __c11_atomic_fetch_sub(object, operand, __ATOMIC_SEQ_CST)
136 #define atomic_fetch_sub_explicit __c11_atomic_fetch_sub
138 #define atomic_fetch_or(object, operand) __c11_atomic_fetch_or(object, operand, __ATOMIC_SEQ_CST)
139 #define atomic_fetch_or_explicit __c11_atomic_fetch_or
141 #define atomic_fetch_xor(object, operand) __c11_atomic_fetch_xor(object, operand, __ATOMIC_SEQ_CST)
142 #define atomic_fetch_xor_explicit __c11_atomic_fetch_xor
144 #define atomic_fetch_and(object, operand) __c11_atomic_fetch_and(object, operand, __ATOMIC_SEQ_CST)
145 #define atomic_fetch_and_explicit __c11_atomic_fetch_and
151 #define ATOMIC_FLAG_INIT { 0 }
164 #define atomic_flag_test_and_set(object) __c11_atomic_exchange(&(object)->_Value, 1, __ATOMIC_SEQ_CST)
165 #define atomic_flag_test_and_set_explicit(object, order) __c11_atomic_exchange(&(object)->_Value, 1, order)
167 #define atomic_flag_clear(object) __c11_atomic_store(&(object)->_Value, 0, __ATOMIC_SEQ_CST)
168 #define atomic_flag_clear_explicit(object, order) __c11_atomic_store(&(object)->_Value, 0, order)
__INTPTR_TYPE__ intptr_t
A signed integer type with the property that any valid pointer to void can be converted to this type,...
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
__PTRDIFF_TYPE__ ptrdiff_t
A signed integer type that is the result of subtracting two pointers.
#define atomic_flag_clear(object)
struct atomic_flag atomic_flag
#define atomic_signal_fence(order)
#define atomic_thread_fence(order)
#define atomic_flag_test_and_set_explicit(object, order)
#define atomic_flag_test_and_set(object)
#define atomic_flag_clear_explicit(object, order)
typedef _Atomic(_Bool) atomic_bool
__UINTMAX_TYPE__ uintmax_t