llvm/compiler-rt/lib/sanitizer_common/sanitizer_atomic.h

//===-- sanitizer_atomic.h --------------------------------------*- C++ -*-===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file is a part of ThreadSanitizer/AddressSanitizer runtime.
//
//===----------------------------------------------------------------------===//

#ifndef SANITIZER_ATOMIC_H
#define SANITIZER_ATOMIC_H

#include "sanitizer_internal_defs.h"

namespace __sanitizer {

enum memory_order {};

struct atomic_uint8_t {};

struct atomic_uint16_t {};

struct atomic_sint32_t {};

struct atomic_uint32_t {};

struct atomic_uint64_t {};

struct atomic_uintptr_t {};

}  // namespace __sanitizer

#if defined(__clang__) || defined(__GNUC__)
# include "sanitizer_atomic_clang.h"
#elif defined(_MSC_VER)
# include "sanitizer_atomic_msvc.h"
#else
# error "Unsupported compiler"
#endif

namespace __sanitizer {

// Clutter-reducing helpers.

template<typename T>
inline typename T::Type atomic_load_relaxed(const volatile T *a) {}

template<typename T>
inline void atomic_store_relaxed(volatile T *a, typename T::Type v) {}

}  // namespace __sanitizer

#endif  // SANITIZER_ATOMIC_H