1 // 2 // detail/fenced_block.hpp 3 // ~~~~~~~~~~~~~~~~~~~~~~~ 4 // 5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com) 6 // 7 // Distributed under the Boost Software License, Version 1.0. (See accompanying 8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 9 // 10 11 #ifndef ASIO_DETAIL_FENCED_BLOCK_HPP 12 #define ASIO_DETAIL_FENCED_BLOCK_HPP 13 14 15 #include "asio/detail/config.hpp" 16 17 #if !defined(ASIO_HAS_THREADS) || defined(ASIO_DISABLE_FENCED_BLOCK) 18 # include "asio/detail/null_fenced_block.hpp" 19 #elif defined(__MACH__) && defined(__APPLE__) 20 # include "asio/detail/macos_fenced_block.hpp" 21 #elif defined(__sun) 22 # include "asio/detail/solaris_fenced_block.hpp" 23 #elif defined(__GNUC__) && defined(__arm__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) 24 # include "asio/detail/gcc_arm_fenced_block.hpp" 25 #elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) 26 # include "asio/detail/gcc_hppa_fenced_block.hpp" 27 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 28 # include "asio/detail/gcc_x86_fenced_block.hpp" 29 #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) && !defined(__INTEL_COMPILER) && !defined(__ICL) && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) 30 # include "asio/detail/gcc_sync_fenced_block.hpp" 31 #else 32 # include "asio/detail/null_fenced_block.hpp" 33 #endif 34 35 namespace asio { 36 namespace detail { 37 38 #if !defined(ASIO_HAS_THREADS) || defined(ASIO_DISABLE_FENCED_BLOCK) 39 typedef null_fenced_block fenced_block; 40 #elif defined(__MACH__) && defined(__APPLE__) 41 typedef macos_fenced_block fenced_block; 42 #elif defined(__sun) 43 typedef solaris_fenced_block fenced_block; 44 #elif defined(__GNUC__) && defined(__arm__) && !defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) 45 typedef gcc_arm_fenced_block fenced_block; 46 #elif defined(__GNUC__) && (defined(__hppa) || defined(__hppa__)) 47 typedef gcc_hppa_fenced_block fenced_block; 48 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) 49 typedef gcc_x86_fenced_block fenced_block; 50 #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)) && !defined(__INTEL_COMPILER) && !defined(__ICL) && !defined(__ICC) && !defined(__ECC) && !defined(__PATHSCALE__) 51 typedef gcc_sync_fenced_block fenced_block; 52 #else 53 typedef null_fenced_block fenced_block; 54 #endif 55 56 } // namespace detail 57 } // namespace asio 58 59 #endif // ASIO_DETAIL_FENCED_BLOCK_HPP 60