chromium/third_party/libc++/src/include/__atomic/aliases.h

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef _LIBCPP___ATOMIC_ALIASES_H
#define _LIBCPP___ATOMIC_ALIASES_H

#include <__atomic/atomic.h>
#include <__atomic/atomic_lock_free.h>
#include <__atomic/contention_t.h>
#include <__atomic/is_always_lock_free.h>
#include <__config>
#include <__type_traits/conditional.h>
#include <__type_traits/make_unsigned.h>
#include <cstddef>
#include <cstdint>

#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
#  pragma GCC system_header
#endif

_LIBCPP_BEGIN_NAMESPACE_STD

atomic_bool;
atomic_char;
atomic_schar;
atomic_uchar;
atomic_short;
atomic_ushort;
atomic_int;
atomic_uint;
atomic_long;
atomic_ulong;
atomic_llong;
atomic_ullong;
#ifndef _LIBCPP_HAS_NO_CHAR8_T
atomic_char8_t;
#endif
atomic_char16_t;
atomic_char32_t;
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
atomic_wchar_t;
#endif

atomic_int_least8_t;
atomic_uint_least8_t;
atomic_int_least16_t;
atomic_uint_least16_t;
atomic_int_least32_t;
atomic_uint_least32_t;
atomic_int_least64_t;
atomic_uint_least64_t;

atomic_int_fast8_t;
atomic_uint_fast8_t;
atomic_int_fast16_t;
atomic_uint_fast16_t;
atomic_int_fast32_t;
atomic_uint_fast32_t;
atomic_int_fast64_t;
atomic_uint_fast64_t;

atomic_int8_t;
atomic_uint8_t;
atomic_int16_t;
atomic_uint16_t;
atomic_int32_t;
atomic_uint32_t;
atomic_int64_t;
atomic_uint64_t;

atomic_intptr_t;
atomic_uintptr_t;
atomic_size_t;
atomic_ptrdiff_t;
atomic_intmax_t;
atomic_uintmax_t;

// C++20 atomic_{signed,unsigned}_lock_free: prefer the contention type most highly, then the largest lock-free type
#if _LIBCPP_STD_VER >= 20
#  if ATOMIC_LLONG_LOCK_FREE == 2
__largest_lock_free_type;
#  elif ATOMIC_INT_LOCK_FREE == 2
using __largest_lock_free_type = int;
#  elif ATOMIC_SHORT_LOCK_FREE == 2
using __largest_lock_free_type = short;
#  elif ATOMIC_CHAR_LOCK_FREE == 2
using __largest_lock_free_type = char;
#  else
#define _LIBCPP_NO_LOCK_FREE_TYPES
#  endif

#  ifndef _LIBCPP_NO_LOCK_FREE_TYPES
__contention_t_or_largest;

atomic_signed_lock_free;
atomic_unsigned_lock_free;
#  endif // !_LIBCPP_NO_LOCK_FREE_TYPES
#endif   // C++20

_LIBCPP_END_NAMESPACE_STD

#endif // _LIBCPP___ATOMIC_ALIASES_H