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#if __cplusplus > 202002L
33#include <atomic>
34
35#define __cpp_lib_stdatomic_h 202011L
36
37#define _Atomic(_Tp) ::std::atomic<_Tp>
38
39using std::memory_order;
40using std::memory_order_relaxed;
41using std::memory_order_consume;
42using std::memory_order_acquire;
43using std::memory_order_release;
44using std::memory_order_acq_rel;
45using std::memory_order_seq_cst;
46using std::atomic_flag;
47using std::atomic_bool;
48using std::atomic_char;
49using std::atomic_schar;
50using std::atomic_uchar;
51using std::atomic_short;
52using std::atomic_ushort;
53using std::atomic_int;
54using std::atomic_uint;
55using std::atomic_long;
56using std::atomic_ulong;
57using std::atomic_llong;
58using std::atomic_ullong;
59#ifdef _GLIBCXX_USE_CHAR8_T
60using std::atomic_char8_t;
61#endif
62using std::atomic_char16_t;
63using std::atomic_char32_t;
64using std::atomic_wchar_t;
65#ifdef _GLIBCXX_USE_C99_STDINT_TR1
66using std::atomic_int8_t;
67using std::atomic_uint8_t;
68using std::atomic_int16_t;
69using std::atomic_uint16_t;
70using std::atomic_int32_t;
71using std::atomic_uint32_t;
72using std::atomic_int64_t;
73using std::atomic_uint64_t;
74using std::atomic_int_least8_t;
75using std::atomic_uint_least8_t;
76using std::atomic_int_least16_t;
77using std::atomic_uint_least16_t;
78using std::atomic_int_least32_t;
79using std::atomic_uint_least32_t;
80using std::atomic_int_least64_t;
81using std::atomic_uint_least64_t;
82using std::atomic_int_fast8_t;
83using std::atomic_uint_fast8_t;
84using std::atomic_int_fast16_t;
85using std::atomic_uint_fast16_t;
86using std::atomic_int_fast32_t;
87using std::atomic_uint_fast32_t;
88using std::atomic_int_fast64_t;
89using std::atomic_uint_fast64_t;
90#endif
91using std::atomic_intptr_t;
92using std::atomic_uintptr_t;
93using std::atomic_size_t;
94using std::atomic_ptrdiff_t;
95#ifdef _GLIBCXX_USE_C99_STDINT_TR1
96using std::atomic_intmax_t;
97using std::atomic_uintmax_t;
98#endif
99using std::atomic_is_lock_free;
100using std::atomic_load;
101using std::atomic_load_explicit;
102using std::atomic_store;
103using std::atomic_store_explicit;
104using std::atomic_exchange;
105using std::atomic_exchange_explicit;
106using std::atomic_compare_exchange_strong;
107using std::atomic_compare_exchange_strong_explicit;
108using std::atomic_compare_exchange_weak;
109using std::atomic_compare_exchange_weak_explicit;
110using std::atomic_fetch_add;
111using std::atomic_fetch_add_explicit;
112using std::atomic_fetch_sub;
113using std::atomic_fetch_sub_explicit;
114using std::atomic_fetch_or;
115using std::atomic_fetch_or_explicit;
116using std::atomic_fetch_xor;
117using std::atomic_fetch_xor_explicit;
118using std::atomic_fetch_and;
119using std::atomic_fetch_and_explicit;
120using std::atomic_flag_test_and_set;
121using std::atomic_flag_test_and_set_explicit;
122using std::atomic_flag_clear;
123using std::atomic_flag_clear_explicit;
124using std::atomic_thread_fence;
125using std::atomic_signal_fence;
126
127#elif defined __clang__
128# include_next <stdatomic.h>
129#endif // C++23
130#endif // _GLIBCXX_STDATOMIC_H
131

source code of include/c++/13/stdatomic.h