brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · d610c86 Raw
41 lines · c
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef _LIBCPP___CXX03___ATOMIC_MEMORY_ORDER_H10#define _LIBCPP___CXX03___ATOMIC_MEMORY_ORDER_H11 12#include <__cxx03/__config>13#include <__cxx03/__type_traits/is_same.h>14#include <__cxx03/__type_traits/underlying_type.h>15 16#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)17#  pragma GCC system_header18#endif19 20_LIBCPP_BEGIN_NAMESPACE_STD21 22// Figure out what the underlying type for `memory_order` would be if it were23// declared as an unscoped enum (accounting for -fshort-enums). Use this result24// to pin the underlying type in C++20.25enum __legacy_memory_order { __mo_relaxed, __mo_consume, __mo_acquire, __mo_release, __mo_acq_rel, __mo_seq_cst };26 27using __memory_order_underlying_t = underlying_type<__legacy_memory_order>::type;28 29enum memory_order {30  memory_order_relaxed = __mo_relaxed,31  memory_order_consume = __mo_consume,32  memory_order_acquire = __mo_acquire,33  memory_order_release = __mo_release,34  memory_order_acq_rel = __mo_acq_rel,35  memory_order_seq_cst = __mo_seq_cst,36};37 38_LIBCPP_END_NAMESPACE_STD39 40#endif // _LIBCPP___CXX03___ATOMIC_MEMORY_ORDER_H41