1 //===-- sanitizer_atomic.h --------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of ThreadSanitizer/AddressSanitizer runtime.
12 //===----------------------------------------------------------------------===//
14 #ifndef SANITIZER_ATOMIC_H
15 #define SANITIZER_ATOMIC_H
17 #include "sanitizer_internal_defs.h"
19 namespace __sanitizer
{
22 memory_order_relaxed
= 1 << 0,
23 memory_order_consume
= 1 << 1,
24 memory_order_acquire
= 1 << 2,
25 memory_order_release
= 1 << 3,
26 memory_order_acq_rel
= 1 << 4,
27 memory_order_seq_cst
= 1 << 5
30 struct atomic_uint8_t
{
32 volatile Type val_dont_use
;
35 struct atomic_uint16_t
{
37 volatile Type val_dont_use
;
40 struct atomic_uint32_t
{
42 volatile Type val_dont_use
;
45 struct atomic_uint64_t
{
47 volatile Type val_dont_use
;
50 struct atomic_uintptr_t
{
52 volatile Type val_dont_use
;
55 } // namespace __sanitizer
58 # include "sanitizer_atomic_clang.h"
59 #elif defined(_MSC_VER)
60 # include "sanitizer_atomic_msvc.h"
62 # error "Unsupported compiler"
65 #endif // SANITIZER_ATOMIC_H