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
41using std::memory_order_relaxed;
42using std::memory_order_consume;
43using std::memory_order_acquire;
44using std::memory_order_release;
45using std::memory_order_acq_rel;
46using std::memory_order_seq_cst;
54using std::atomic_int;
60#ifdef _GLIBCXX_USE_CHAR8_T
61using std::atomic_char8_t;
62#endif
66#ifdef _GLIBCXX_USE_C99_STDINT
91#endif
96#ifdef _GLIBCXX_USE_C99_STDINT
99#endif
100using std::atomic_is_lock_free;
101using std::atomic_load;
102using std::atomic_load_explicit;
103using std::atomic_store;
104using std::atomic_store_explicit;
105using std::atomic_exchange;
106using std::atomic_exchange_explicit;
107using std::atomic_compare_exchange_strong;
108using std::atomic_compare_exchange_strong_explicit;
109using std::atomic_compare_exchange_weak;
110using std::atomic_compare_exchange_weak_explicit;
111using std::atomic_fetch_add;
112using std::atomic_fetch_add_explicit;
113using std::atomic_fetch_sub;
114using std::atomic_fetch_sub_explicit;
115using std::atomic_fetch_or;
116using std::atomic_fetch_or_explicit;
117using std::atomic_fetch_xor;
118using std::atomic_fetch_xor_explicit;
119using std::atomic_fetch_and;
120using std::atomic_fetch_and_explicit;
121using std::atomic_flag_test_and_set;
122using std::atomic_flag_test_and_set_explicit;
123using std::atomic_flag_clear;
124using std::atomic_flag_clear_explicit;
125using std::atomic_thread_fence;
126using std::atomic_signal_fence;
127
128#elif defined _GLIBCXX_CLANG
129# include_next <stdatomic.h>
130#endif // __cpp_lib_stdatomic_h
131#endif // _GLIBCXX_STDATOMIC_H
atomic< unsigned long > atomic_ulong
atomic_ulong
Definition atomic:1092
atomic< intmax_t > atomic_intmax_t
atomic_intmax_t
Definition atomic:1206
atomic< uintptr_t > atomic_uintptr_t
atomic_uintptr_t
Definition atomic:1197
atomic< signed char > atomic_schar
atomic_schar
Definition atomic:1071
atomic< int_least8_t > atomic_int_least8_t
atomic_int_least8_t
Definition atomic:1144
atomic< unsigned long long > atomic_ullong
atomic_ullong
Definition atomic:1098
atomic< uint_fast8_t > atomic_uint_fast8_t
atomic_uint_fast8_t
Definition atomic:1172
atomic< intptr_t > atomic_intptr_t
atomic_intptr_t
Definition atomic:1194
atomic< int16_t > atomic_int16_t
atomic_int16_t
Definition atomic:1125
atomic< size_t > atomic_size_t
atomic_size_t
Definition atomic:1200
atomic< long > atomic_long
atomic_long
Definition atomic:1089
atomic< uint_least8_t > atomic_uint_least8_t
atomic_uint_least8_t
Definition atomic:1147
atomic< short > atomic_short
atomic_short
Definition atomic:1077
atomic< uint_least16_t > atomic_uint_least16_t
atomic_uint_least16_t
Definition atomic:1153
atomic< uint16_t > atomic_uint16_t
atomic_uint16_t
Definition atomic:1128
atomic< uint64_t > atomic_uint64_t
atomic_uint64_t
Definition atomic:1140
atomic< int_least32_t > atomic_int_least32_t
atomic_int_least32_t
Definition atomic:1156
atomic< uint8_t > atomic_uint8_t
atomic_uint8_t
Definition atomic:1122
atomic< wchar_t > atomic_wchar_t
atomic_wchar_t
Definition atomic:1101
atomic< unsigned int > atomic_uint
atomic_uint
Definition atomic:1086
atomic< uint_least32_t > atomic_uint_least32_t
atomic_uint_least32_t
Definition atomic:1159
atomic< uint_fast64_t > atomic_uint_fast64_t
atomic_uint_fast64_t
Definition atomic:1190
atomic< int_fast32_t > atomic_int_fast32_t
atomic_int_fast32_t
Definition atomic:1181
atomic< char > atomic_char
atomic_char
Definition atomic:1068
atomic< int > atomic_int
atomic_int
Definition atomic:1083
atomic< uint_least64_t > atomic_uint_least64_t
atomic_uint_least64_t
Definition atomic:1165
atomic< int64_t > atomic_int64_t
atomic_int64_t
Definition atomic:1137
atomic< uintmax_t > atomic_uintmax_t
atomic_uintmax_t
Definition atomic:1209
atomic< int_fast16_t > atomic_int_fast16_t
atomic_int_fast16_t
Definition atomic:1175
atomic< int32_t > atomic_int32_t
atomic_int32_t
Definition atomic:1131
atomic< uint_fast16_t > atomic_uint_fast16_t
atomic_uint_fast16_t
Definition atomic:1178
atomic< int8_t > atomic_int8_t
atomic_int8_t
Definition atomic:1119
atomic< long long > atomic_llong
atomic_llong
Definition atomic:1095
atomic< char16_t > atomic_char16_t
atomic_char16_t
Definition atomic:1109
atomic< int_fast64_t > atomic_int_fast64_t
atomic_int_fast64_t
Definition atomic:1187
atomic< ptrdiff_t > atomic_ptrdiff_t
atomic_ptrdiff_t
Definition atomic:1203
atomic< char32_t > atomic_char32_t
atomic_char32_t
Definition atomic:1112
atomic< int_least16_t > atomic_int_least16_t
atomic_int_least16_t
Definition atomic:1150
atomic< unsigned char > atomic_uchar
atomic_uchar
Definition atomic:1074
atomic< int_fast8_t > atomic_int_fast8_t
atomic_int_fast8_t
Definition atomic:1169
memory_order
Enumeration for memory_order.
Definition atomic_base.h:66
atomic< unsigned short > atomic_ushort
atomic_ushort
Definition atomic:1080
atomic< int_least64_t > atomic_int_least64_t
atomic_int_least64_t
Definition atomic:1162
atomic< bool > atomic_bool
atomic_bool
Definition atomic:1065
atomic< uint_fast32_t > atomic_uint_fast32_t
atomic_uint_fast32_t
Definition atomic:1184
atomic< uint32_t > atomic_uint32_t
atomic_uint32_t
Definition atomic:1134
atomic_flag