Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:43:51

0001 /*
0002  * Distributed under the Boost Software License, Version 1.0.
0003  * (See accompanying file LICENSE_1_0.txt or copy at
0004  * http://www.boost.org/LICENSE_1_0.txt)
0005  *
0006  * Copyright (c) 2009 Helge Bahmann
0007  * Copyright (c) 2012 Tim Blechmann
0008  * Copyright (c) 2014, 2019 Andrey Semashev
0009  */
0010 /*!
0011  * \file   atomic/detail/ops_msvc_common.hpp
0012  *
0013  * This header contains common tools for MSVC implementation of the atomic operations.
0014  */
0015 
0016 #ifndef BOOST_ATOMIC_DETAIL_OPS_MSVC_COMMON_HPP_INCLUDED_
0017 #define BOOST_ATOMIC_DETAIL_OPS_MSVC_COMMON_HPP_INCLUDED_
0018 
0019 #include <boost/atomic/detail/config.hpp>
0020 #include <boost/atomic/detail/header.hpp>
0021 
0022 #ifdef BOOST_HAS_PRAGMA_ONCE
0023 #pragma once
0024 #endif
0025 
0026 // Define compiler barriers
0027 #if defined(__INTEL_COMPILER)
0028 #define BOOST_ATOMIC_DETAIL_COMPILER_BARRIER() __memory_barrier()
0029 #elif defined(__clang__)
0030 #define BOOST_ATOMIC_DETAIL_COMPILER_BARRIER() __atomic_signal_fence(__ATOMIC_SEQ_CST)
0031 #elif defined(_MSC_VER) && !defined(_WIN32_WCE)
0032 extern "C" void _ReadWriteBarrier(void);
0033 #pragma intrinsic(_ReadWriteBarrier)
0034 #define BOOST_ATOMIC_DETAIL_COMPILER_BARRIER() _ReadWriteBarrier()
0035 #endif
0036 
0037 #ifndef BOOST_ATOMIC_DETAIL_COMPILER_BARRIER
0038 #define BOOST_ATOMIC_DETAIL_COMPILER_BARRIER()
0039 #endif
0040 
0041 #include <boost/atomic/detail/footer.hpp>
0042 
0043 #endif // BOOST_ATOMIC_DETAIL_OPS_MSVC_COMMON_HPP_INCLUDED_