Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:14:08

0001 // -*- C++ -*-
0002 //===----------------------------------------------------------------------===//
0003 //
0004 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0005 // See https://llvm.org/LICENSE.txt for license information.
0006 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0007 //
0008 //===----------------------------------------------------------------------===//
0009 
0010 #ifndef _LIBCPP_STDATOMIC_H
0011 #define _LIBCPP_STDATOMIC_H
0012 
0013 /*
0014     stdatomic.h synopsis
0015 
0016 template<class T>
0017   using std-atomic = std::atomic<T>;        // exposition only
0018 
0019 #define _Atomic(T) std-atomic<T>
0020 
0021 #define ATOMIC_BOOL_LOCK_FREE see below
0022 #define ATOMIC_CHAR_LOCK_FREE see below
0023 #define ATOMIC_CHAR16_T_LOCK_FREE see below
0024 #define ATOMIC_CHAR32_T_LOCK_FREE see below
0025 #define ATOMIC_WCHAR_T_LOCK_FREE see below
0026 #define ATOMIC_SHORT_LOCK_FREE see below
0027 #define ATOMIC_INT_LOCK_FREE see below
0028 #define ATOMIC_LONG_LOCK_FREE see below
0029 #define ATOMIC_LLONG_LOCK_FREE see below
0030 #define ATOMIC_POINTER_LOCK_FREE see below
0031 
0032 using std::memory_order                // see below
0033 using std::memory_order_relaxed        // see below
0034 using std::memory_order_consume        // see below
0035 using std::memory_order_acquire        // see below
0036 using std::memory_order_release        // see below
0037 using std::memory_order_acq_rel        // see below
0038 using std::memory_order_seq_cst        // see below
0039 
0040 using std::atomic_flag                 // see below
0041 
0042 using std::atomic_bool                 // see below
0043 using std::atomic_char                 // see below
0044 using std::atomic_schar                // see below
0045 using std::atomic_uchar                // see below
0046 using std::atomic_short                // see below
0047 using std::atomic_ushort               // see below
0048 using std::atomic_int                  // see below
0049 using std::atomic_uint                 // see below
0050 using std::atomic_long                 // see below
0051 using std::atomic_ulong                // see below
0052 using std::atomic_llong                // see below
0053 using std::atomic_ullong               // see below
0054 using std::atomic_char8_t              // see below
0055 using std::atomic_char16_t             // see below
0056 using std::atomic_char32_t             // see below
0057 using std::atomic_wchar_t              // see below
0058 using std::atomic_int8_t               // see below
0059 using std::atomic_uint8_t              // see below
0060 using std::atomic_int16_t              // see below
0061 using std::atomic_uint16_t             // see below
0062 using std::atomic_int32_t              // see below
0063 using std::atomic_uint32_t             // see below
0064 using std::atomic_int64_t              // see below
0065 using std::atomic_uint64_t             // see below
0066 using std::atomic_int_least8_t         // see below
0067 using std::atomic_uint_least8_t        // see below
0068 using std::atomic_int_least16_t        // see below
0069 using std::atomic_uint_least16_t       // see below
0070 using std::atomic_int_least32_t        // see below
0071 using std::atomic_uint_least32_t       // see below
0072 using std::atomic_int_least64_t        // see below
0073 using std::atomic_uint_least64_t       // see below
0074 using std::atomic_int_fast8_t          // see below
0075 using std::atomic_uint_fast8_t         // see below
0076 using std::atomic_int_fast16_t         // see below
0077 using std::atomic_uint_fast16_t        // see below
0078 using std::atomic_int_fast32_t         // see below
0079 using std::atomic_uint_fast32_t        // see below
0080 using std::atomic_int_fast64_t         // see below
0081 using std::atomic_uint_fast64_t        // see below
0082 using std::atomic_intptr_t             // see below
0083 using std::atomic_uintptr_t            // see below
0084 using std::atomic_size_t               // see below
0085 using std::atomic_ptrdiff_t            // see below
0086 using std::atomic_intmax_t             // see below
0087 using std::atomic_uintmax_t            // see below
0088 
0089 using std::atomic_is_lock_free                         // see below
0090 using std::atomic_load                                 // see below
0091 using std::atomic_load_explicit                        // see below
0092 using std::atomic_store                                // see below
0093 using std::atomic_store_explicit                       // see below
0094 using std::atomic_exchange                             // see below
0095 using std::atomic_exchange_explicit                    // see below
0096 using std::atomic_compare_exchange_strong              // see below
0097 using std::atomic_compare_exchange_strong_explicit     // see below
0098 using std::atomic_compare_exchange_weak                // see below
0099 using std::atomic_compare_exchange_weak_explicit       // see below
0100 using std::atomic_fetch_add                            // see below
0101 using std::atomic_fetch_add_explicit                   // see below
0102 using std::atomic_fetch_sub                            // see below
0103 using std::atomic_fetch_sub_explicit                   // see below
0104 using std::atomic_fetch_or                             // see below
0105 using std::atomic_fetch_or_explicit                    // see below
0106 using std::atomic_fetch_xor                            // see below
0107 using std::atomic_fetch_xor_explicit                   // see below
0108 using std::atomic_fetch_and                            // see below
0109 using std::atomic_fetch_and_explicit                   // see below
0110 using std::atomic_flag_test_and_set                    // see below
0111 using std::atomic_flag_test_and_set_explicit           // see below
0112 using std::atomic_flag_clear                           // see below
0113 using std::atomic_flag_clear_explicit                  // see below
0114 
0115 using std::atomic_thread_fence                         // see below
0116 using std::atomic_signal_fence                         // see below
0117 
0118 */
0119 
0120 #if defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0121 #  include <__cxx03/stdatomic.h>
0122 #else
0123 #  include <__config>
0124 
0125 #  if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0126 #    pragma GCC system_header
0127 #  endif
0128 
0129 #  if defined(__cplusplus) && _LIBCPP_STD_VER >= 23
0130 
0131 #    include <atomic>
0132 #    include <version>
0133 
0134 #    ifdef _Atomic
0135 #      undef _Atomic
0136 #    endif
0137 
0138 #    define _Atomic(_Tp) ::std::atomic<_Tp>
0139 
0140 using std::memory_order _LIBCPP_USING_IF_EXISTS;
0141 using std::memory_order_relaxed _LIBCPP_USING_IF_EXISTS;
0142 using std::memory_order_consume _LIBCPP_USING_IF_EXISTS;
0143 using std::memory_order_acquire _LIBCPP_USING_IF_EXISTS;
0144 using std::memory_order_release _LIBCPP_USING_IF_EXISTS;
0145 using std::memory_order_acq_rel _LIBCPP_USING_IF_EXISTS;
0146 using std::memory_order_seq_cst _LIBCPP_USING_IF_EXISTS;
0147 
0148 using std::atomic_flag _LIBCPP_USING_IF_EXISTS;
0149 
0150 using std::atomic_bool _LIBCPP_USING_IF_EXISTS;
0151 using std::atomic_char _LIBCPP_USING_IF_EXISTS;
0152 using std::atomic_schar _LIBCPP_USING_IF_EXISTS;
0153 using std::atomic_uchar _LIBCPP_USING_IF_EXISTS;
0154 using std::atomic_short _LIBCPP_USING_IF_EXISTS;
0155 using std::atomic_ushort _LIBCPP_USING_IF_EXISTS;
0156 using std::atomic_int _LIBCPP_USING_IF_EXISTS;
0157 using std::atomic_uint _LIBCPP_USING_IF_EXISTS;
0158 using std::atomic_long _LIBCPP_USING_IF_EXISTS;
0159 using std::atomic_ulong _LIBCPP_USING_IF_EXISTS;
0160 using std::atomic_llong _LIBCPP_USING_IF_EXISTS;
0161 using std::atomic_ullong _LIBCPP_USING_IF_EXISTS;
0162 #    if _LIBCPP_HAS_CHAR8_T
0163 using std::atomic_char8_t _LIBCPP_USING_IF_EXISTS;
0164 #    endif
0165 using std::atomic_char16_t _LIBCPP_USING_IF_EXISTS;
0166 using std::atomic_char32_t _LIBCPP_USING_IF_EXISTS;
0167 #    if _LIBCPP_HAS_WIDE_CHARACTERS
0168 using std::atomic_wchar_t _LIBCPP_USING_IF_EXISTS;
0169 #    endif
0170 
0171 using std::atomic_int8_t _LIBCPP_USING_IF_EXISTS;
0172 using std::atomic_uint8_t _LIBCPP_USING_IF_EXISTS;
0173 using std::atomic_int16_t _LIBCPP_USING_IF_EXISTS;
0174 using std::atomic_uint16_t _LIBCPP_USING_IF_EXISTS;
0175 using std::atomic_int32_t _LIBCPP_USING_IF_EXISTS;
0176 using std::atomic_uint32_t _LIBCPP_USING_IF_EXISTS;
0177 using std::atomic_int64_t _LIBCPP_USING_IF_EXISTS;
0178 using std::atomic_uint64_t _LIBCPP_USING_IF_EXISTS;
0179 
0180 using std::atomic_int_least8_t _LIBCPP_USING_IF_EXISTS;
0181 using std::atomic_uint_least8_t _LIBCPP_USING_IF_EXISTS;
0182 using std::atomic_int_least16_t _LIBCPP_USING_IF_EXISTS;
0183 using std::atomic_uint_least16_t _LIBCPP_USING_IF_EXISTS;
0184 using std::atomic_int_least32_t _LIBCPP_USING_IF_EXISTS;
0185 using std::atomic_uint_least32_t _LIBCPP_USING_IF_EXISTS;
0186 using std::atomic_int_least64_t _LIBCPP_USING_IF_EXISTS;
0187 using std::atomic_uint_least64_t _LIBCPP_USING_IF_EXISTS;
0188 
0189 using std::atomic_int_fast8_t _LIBCPP_USING_IF_EXISTS;
0190 using std::atomic_uint_fast8_t _LIBCPP_USING_IF_EXISTS;
0191 using std::atomic_int_fast16_t _LIBCPP_USING_IF_EXISTS;
0192 using std::atomic_uint_fast16_t _LIBCPP_USING_IF_EXISTS;
0193 using std::atomic_int_fast32_t _LIBCPP_USING_IF_EXISTS;
0194 using std::atomic_uint_fast32_t _LIBCPP_USING_IF_EXISTS;
0195 using std::atomic_int_fast64_t _LIBCPP_USING_IF_EXISTS;
0196 using std::atomic_uint_fast64_t _LIBCPP_USING_IF_EXISTS;
0197 
0198 using std::atomic_intptr_t _LIBCPP_USING_IF_EXISTS;
0199 using std::atomic_uintptr_t _LIBCPP_USING_IF_EXISTS;
0200 using std::atomic_size_t _LIBCPP_USING_IF_EXISTS;
0201 using std::atomic_ptrdiff_t _LIBCPP_USING_IF_EXISTS;
0202 using std::atomic_intmax_t _LIBCPP_USING_IF_EXISTS;
0203 using std::atomic_uintmax_t _LIBCPP_USING_IF_EXISTS;
0204 
0205 using std::atomic_compare_exchange_strong _LIBCPP_USING_IF_EXISTS;
0206 using std::atomic_compare_exchange_strong_explicit _LIBCPP_USING_IF_EXISTS;
0207 using std::atomic_compare_exchange_weak _LIBCPP_USING_IF_EXISTS;
0208 using std::atomic_compare_exchange_weak_explicit _LIBCPP_USING_IF_EXISTS;
0209 using std::atomic_exchange _LIBCPP_USING_IF_EXISTS;
0210 using std::atomic_exchange_explicit _LIBCPP_USING_IF_EXISTS;
0211 using std::atomic_fetch_add _LIBCPP_USING_IF_EXISTS;
0212 using std::atomic_fetch_add_explicit _LIBCPP_USING_IF_EXISTS;
0213 using std::atomic_fetch_and _LIBCPP_USING_IF_EXISTS;
0214 using std::atomic_fetch_and_explicit _LIBCPP_USING_IF_EXISTS;
0215 using std::atomic_fetch_or _LIBCPP_USING_IF_EXISTS;
0216 using std::atomic_fetch_xor_explicit _LIBCPP_USING_IF_EXISTS;
0217 using std::atomic_fetch_xor _LIBCPP_USING_IF_EXISTS;
0218 using std::atomic_fetch_or_explicit _LIBCPP_USING_IF_EXISTS;
0219 using std::atomic_fetch_sub _LIBCPP_USING_IF_EXISTS;
0220 using std::atomic_fetch_sub_explicit _LIBCPP_USING_IF_EXISTS;
0221 using std::atomic_flag_clear _LIBCPP_USING_IF_EXISTS;
0222 using std::atomic_flag_clear_explicit _LIBCPP_USING_IF_EXISTS;
0223 using std::atomic_flag_test_and_set _LIBCPP_USING_IF_EXISTS;
0224 using std::atomic_flag_test_and_set_explicit _LIBCPP_USING_IF_EXISTS;
0225 using std::atomic_is_lock_free _LIBCPP_USING_IF_EXISTS;
0226 using std::atomic_load _LIBCPP_USING_IF_EXISTS;
0227 using std::atomic_load_explicit _LIBCPP_USING_IF_EXISTS;
0228 using std::atomic_store _LIBCPP_USING_IF_EXISTS;
0229 using std::atomic_store_explicit _LIBCPP_USING_IF_EXISTS;
0230 
0231 using std::atomic_signal_fence _LIBCPP_USING_IF_EXISTS;
0232 using std::atomic_thread_fence _LIBCPP_USING_IF_EXISTS;
0233 
0234 #  elif defined(_LIBCPP_COMPILER_CLANG_BASED)
0235 
0236 // Before C++23, we include the next <stdatomic.h> on the path to avoid hijacking
0237 // the header. We do this because Clang has historically shipped a <stdatomic.h>
0238 // header that would be available in all Standard modes, and we don't want to
0239 // break that use case.
0240 #    if __has_include_next(<stdatomic.h>)
0241 #      include_next <stdatomic.h>
0242 #    endif
0243 
0244 #  endif // defined(__cplusplus) && _LIBCPP_STD_VER >= 23
0245 #endif   // defined(__cplusplus) && __cplusplus < 201103L && defined(_LIBCPP_USE_FROZEN_CXX03_HEADERS)
0246 
0247 #endif // _LIBCPP_STDATOMIC_H