[Sanitizer] extend internal libc with stat/fstat/lstat functions
[blocksruntime.git] / lib / sanitizer_common / sanitizer_atomic.h
blob61e6dfd59f99c6600d96e3398a5c3748e28b04ca
1 //===-- sanitizer_atomic.h --------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
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 {
21 enum memory_order {
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 {
31 typedef u8 Type;
32 volatile Type val_dont_use;
35 struct atomic_uint16_t {
36 typedef u16 Type;
37 volatile Type val_dont_use;
40 struct atomic_uint32_t {
41 typedef u32 Type;
42 volatile Type val_dont_use;
45 struct atomic_uint64_t {
46 typedef u64 Type;
47 volatile Type val_dont_use;
50 struct atomic_uintptr_t {
51 typedef uptr Type;
52 volatile Type val_dont_use;
55 } // namespace __sanitizer
57 #if defined(__GNUC__)
58 # include "sanitizer_atomic_clang.h"
59 #elif defined(_MSC_VER)
60 # include "sanitizer_atomic_msvc.h"
61 #else
62 # error "Unsupported compiler"
63 #endif
65 #endif // SANITIZER_ATOMIC_H