libstdc++: stdatomic.h Source File

libstdc++

stdatomic.h
Go to the documentation of this file.
1// C compatibility header <stdatomic.h> -*- C++ -*-
2
3// Copyright The GNU Toolchain Authors.
4//
5// This file is part of the GNU ISO C++ Library. This library is free
6// software; you can redistribute it and/or modify it under the
7// terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 3, or (at your option)
9// any later version.
10
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15
16// Under Section 7 of GPL version 3, you are granted additional
17// permissions described in the GCC Runtime Library Exception, version
18// 3.1, as published by the Free Software Foundation.
19
20// You should have received a copy of the GNU General Public License and
21// a copy of the GCC Runtime Library Exception along with this program;
22// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23// <http://www.gnu.org/licenses/>.
24
25/** @file include/stdatomic.h
26 * This is a Standard C++ Library header.
27 */
28
29#ifndef _GLIBCXX_STDATOMIC_H
30#define _GLIBCXX_STDATOMIC_H
31
32#define __glibcxx_want_stdatomic_h
33#include <bits/version.h>
34
35#ifdef __cpp_lib_stdatomic_h // C++ >= 23
36#include <atomic>
37
38#define _Atomic(_Tp) ::std::atomic<_Tp>
39
40using std::memory_order;
41using std::memory_order_relaxed;
42#pragma GCC diagnostic push
43#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
44using std::memory_order_consume;
45#pragma GCC diagnostic pop
46using std::memory_order_acquire;
47using std::memory_order_release;
48using std::memory_order_acq_rel;
49using std::memory_order_seq_cst;
50using std::atomic_flag;
51using std::atomic_bool;
52using std::atomic_char;
53using std::atomic_schar;
54using std::atomic_uchar;
55using std::atomic_short;
56using std::atomic_ushort;
57using std::atomic_int;
58using std::atomic_uint;
59using std::atomic_long;
60using std::atomic_ulong;
61using std::atomic_llong;
62using std::atomic_ullong;
63#ifdef _GLIBCXX_USE_CHAR8_T
64using std::atomic_char8_t;
65#endif
66using std::atomic_char16_t;
67using std::atomic_char32_t;
68using std::atomic_wchar_t;
69#ifdef _GLIBCXX_USE_C99_STDINT
70using std::atomic_int8_t;
71using std::atomic_uint8_t;
72using std::atomic_int16_t;
73using std::atomic_uint16_t;
74using std::atomic_int32_t;
75using std::atomic_uint32_t;
76using std::atomic_int64_t;
77using std::atomic_uint64_t;
78using std::atomic_int_least8_t;
79using std::atomic_uint_least8_t;
80using std::atomic_int_least16_t;
81using std::atomic_uint_least16_t;
82using std::atomic_int_least32_t;
83using std::atomic_uint_least32_t;
84using std::atomic_int_least64_t;
85using std::atomic_uint_least64_t;
86using std::atomic_int_fast8_t;
87using std::atomic_uint_fast8_t;
88using std::atomic_int_fast16_t;
89using std::atomic_uint_fast16_t;
90using std::atomic_int_fast32_t;
91using std::atomic_uint_fast32_t;
92using std::atomic_int_fast64_t;
93using std::atomic_uint_fast64_t;
94#endif
95using std::atomic_intptr_t;
96using std::atomic_uintptr_t;
97using std::atomic_size_t;
98using std::atomic_ptrdiff_t;
99#ifdef _GLIBCXX_USE_C99_STDINT
100using std::atomic_intmax_t;
101using std::atomic_uintmax_t;
102#endif
103using std::atomic_is_lock_free;
104using std::atomic_load;
105using std::atomic_load_explicit;
106using std::atomic_store;
107using std::atomic_store_explicit;
108using std::atomic_exchange;
109using std::atomic_exchange_explicit;
110using std::atomic_compare_exchange_strong;
111using std::atomic_compare_exchange_strong_explicit;
112using std::atomic_compare_exchange_weak;
113using std::atomic_compare_exchange_weak_explicit;
114using std::atomic_fetch_add;
115using std::atomic_fetch_add_explicit;
116using std::atomic_fetch_sub;
117using std::atomic_fetch_sub_explicit;
118using std::atomic_fetch_or;
119using std::atomic_fetch_or_explicit;
120using std::atomic_fetch_xor;
121using std::atomic_fetch_xor_explicit;
122using std::atomic_fetch_and;
123using std::atomic_fetch_and_explicit;
124using std::atomic_flag_test_and_set;
125using std::atomic_flag_test_and_set_explicit;
126using std::atomic_flag_clear;
127using std::atomic_flag_clear_explicit;
128using std::atomic_thread_fence;
129using std::atomic_signal_fence;
130
131#elif defined _GLIBCXX_CLANG
132# include_next <stdatomic.h>
133#endif // __cpp_lib_stdatomic_h
134#endif // _GLIBCXX_STDATOMIC_H
atomic
version.h
std::atomic_ulong
atomic< unsigned long > atomic_ulong
atomic_ulong
Definition atomic:1126
std::atomic_intmax_t
atomic< intmax_t > atomic_intmax_t
atomic_intmax_t
Definition atomic:1240
std::atomic_uintptr_t
atomic< uintptr_t > atomic_uintptr_t
atomic_uintptr_t
Definition atomic:1231
std::atomic_schar
atomic< signed char > atomic_schar
atomic_schar
Definition atomic:1105
std::atomic_int_least8_t
atomic< int_least8_t > atomic_int_least8_t
atomic_int_least8_t
Definition atomic:1178
std::atomic_ullong
atomic< unsigned long long > atomic_ullong
atomic_ullong
Definition atomic:1132
std::atomic_uint_fast8_t
atomic< uint_fast8_t > atomic_uint_fast8_t
atomic_uint_fast8_t
Definition atomic:1206
std::atomic_intptr_t
atomic< intptr_t > atomic_intptr_t
atomic_intptr_t
Definition atomic:1228
std::atomic_int16_t
atomic< int16_t > atomic_int16_t
atomic_int16_t
Definition atomic:1159
std::atomic_size_t
atomic< size_t > atomic_size_t
atomic_size_t
Definition atomic:1234
std::atomic_long
atomic< long > atomic_long
atomic_long
Definition atomic:1123
std::atomic_uint_least8_t
atomic< uint_least8_t > atomic_uint_least8_t
atomic_uint_least8_t
Definition atomic:1181
std::atomic_short
atomic< short > atomic_short
atomic_short
Definition atomic:1111
std::atomic_uint_least16_t
atomic< uint_least16_t > atomic_uint_least16_t
atomic_uint_least16_t
Definition atomic:1187
std::atomic_uint16_t
atomic< uint16_t > atomic_uint16_t
atomic_uint16_t
Definition atomic:1162
std::atomic_uint64_t
atomic< uint64_t > atomic_uint64_t
atomic_uint64_t
Definition atomic:1174
std::atomic_int_least32_t
atomic< int_least32_t > atomic_int_least32_t
atomic_int_least32_t
Definition atomic:1190
std::atomic_uint8_t
atomic< uint8_t > atomic_uint8_t
atomic_uint8_t
Definition atomic:1156
std::atomic_wchar_t
atomic< wchar_t > atomic_wchar_t
atomic_wchar_t
Definition atomic:1135
std::atomic_uint
atomic< unsigned int > atomic_uint
atomic_uint
Definition atomic:1120
std::atomic_uint_least32_t
atomic< uint_least32_t > atomic_uint_least32_t
atomic_uint_least32_t
Definition atomic:1193
std::atomic_uint_fast64_t
atomic< uint_fast64_t > atomic_uint_fast64_t
atomic_uint_fast64_t
Definition atomic:1224
std::atomic_int_fast32_t
atomic< int_fast32_t > atomic_int_fast32_t
atomic_int_fast32_t
Definition atomic:1215
std::atomic_char
atomic< char > atomic_char
atomic_char
Definition atomic:1102
std::atomic_int
atomic< int > atomic_int
atomic_int
Definition atomic:1117
std::atomic_uint_least64_t
atomic< uint_least64_t > atomic_uint_least64_t
atomic_uint_least64_t
Definition atomic:1199
std::atomic_int64_t
atomic< int64_t > atomic_int64_t
atomic_int64_t
Definition atomic:1171
std::atomic_uintmax_t
atomic< uintmax_t > atomic_uintmax_t
atomic_uintmax_t
Definition atomic:1243
std::atomic_int_fast16_t
atomic< int_fast16_t > atomic_int_fast16_t
atomic_int_fast16_t
Definition atomic:1209
std::atomic_int32_t
atomic< int32_t > atomic_int32_t
atomic_int32_t
Definition atomic:1165
std::atomic_uint_fast16_t
atomic< uint_fast16_t > atomic_uint_fast16_t
atomic_uint_fast16_t
Definition atomic:1212
std::atomic_int8_t
atomic< int8_t > atomic_int8_t
atomic_int8_t
Definition atomic:1153
std::atomic_llong
atomic< long long > atomic_llong
atomic_llong
Definition atomic:1129
std::atomic_char16_t
atomic< char16_t > atomic_char16_t
atomic_char16_t
Definition atomic:1143
std::atomic_int_fast64_t
atomic< int_fast64_t > atomic_int_fast64_t
atomic_int_fast64_t
Definition atomic:1221
std::atomic_ptrdiff_t
atomic< ptrdiff_t > atomic_ptrdiff_t
atomic_ptrdiff_t
Definition atomic:1237
std::atomic_char32_t
atomic< char32_t > atomic_char32_t
atomic_char32_t
Definition atomic:1146
std::atomic_int_least16_t
atomic< int_least16_t > atomic_int_least16_t
atomic_int_least16_t
Definition atomic:1184
std::atomic_uchar
atomic< unsigned char > atomic_uchar
atomic_uchar
Definition atomic:1108
std::atomic_int_fast8_t
atomic< int_fast8_t > atomic_int_fast8_t
atomic_int_fast8_t
Definition atomic:1203
std::memory_order
memory_order
Enumeration for memory_order.
Definition atomic_base.h:66
std::atomic_ushort
atomic< unsigned short > atomic_ushort
atomic_ushort
Definition atomic:1114
std::atomic_int_least64_t
atomic< int_least64_t > atomic_int_least64_t
atomic_int_least64_t
Definition atomic:1196
std::atomic_bool
atomic< bool > atomic_bool
atomic_bool
Definition atomic:1099
std::atomic_uint_fast32_t
atomic< uint_fast32_t > atomic_uint_fast32_t
atomic_uint_fast32_t
Definition atomic:1218
std::atomic_uint32_t
atomic< uint32_t > atomic_uint32_t
atomic_uint32_t
Definition atomic:1168
std::atomic_flag
atomic_flag
Definition atomic_base.h:218