annotate DEPENDENCIES/generic/include/boost/atomic/detail/platform.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@101 1 /*
Chris@101 2 * Distributed under the Boost Software License, Version 1.0.
Chris@101 3 * (See accompanying file LICENSE_1_0.txt or copy at
Chris@101 4 * http://www.boost.org/LICENSE_1_0.txt)
Chris@101 5 *
Chris@101 6 * Copyright (c) 2009 Helge Bahmann
Chris@101 7 * Copyright (c) 2014 Andrey Semashev
Chris@101 8 */
Chris@101 9 /*!
Chris@101 10 * \file atomic/detail/platform.hpp
Chris@101 11 *
Chris@101 12 * This header defines macros for the target platform detection
Chris@101 13 */
Chris@16 14
Chris@101 15 #ifndef BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_
Chris@101 16 #define BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_
Chris@16 17
Chris@16 18 #include <boost/atomic/detail/config.hpp>
Chris@16 19
Chris@16 20 #ifdef BOOST_HAS_PRAGMA_ONCE
Chris@16 21 #pragma once
Chris@16 22 #endif
Chris@16 23
Chris@101 24 #if !defined(BOOST_ATOMIC_FORCE_FALLBACK)
Chris@16 25
Chris@101 26 // Compiler-based backends
Chris@101 27 #if ((defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407)) ||\
Chris@101 28 (defined(BOOST_CLANG) && ((__clang_major__ * 100 + __clang_minor__) >= 302))) &&\
Chris@101 29 (\
Chris@101 30 (__GCC_ATOMIC_BOOL_LOCK_FREE + 0) == 2 ||\
Chris@101 31 (__GCC_ATOMIC_CHAR_LOCK_FREE + 0) == 2 ||\
Chris@101 32 (__GCC_ATOMIC_SHORT_LOCK_FREE + 0) == 2 ||\
Chris@101 33 (__GCC_ATOMIC_INT_LOCK_FREE + 0) == 2 ||\
Chris@101 34 (__GCC_ATOMIC_LONG_LOCK_FREE + 0) == 2 ||\
Chris@101 35 (__GCC_ATOMIC_LLONG_LOCK_FREE + 0) == 2\
Chris@101 36 )
Chris@101 37
Chris@101 38 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_atomic
Chris@16 39
Chris@16 40 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
Chris@16 41
Chris@101 42 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_x86
Chris@16 43
Chris@16 44 #elif defined(__GNUC__) && (defined(__POWERPC__) || defined(__PPC__))
Chris@16 45
Chris@101 46 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_ppc
Chris@16 47
Chris@16 48 // This list of ARM architecture versions comes from Apple's arm/arch.h header.
Chris@16 49 // I don't know how complete it is.
Chris@101 50 #elif defined(__GNUC__) &&\
Chris@101 51 (\
Chris@101 52 defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) ||\
Chris@101 53 defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) ||\
Chris@101 54 defined(__ARM_ARCH_6ZK__) ||\
Chris@101 55 defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) ||\
Chris@101 56 defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) ||\
Chris@101 57 defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__)\
Chris@101 58 )
Chris@16 59
Chris@101 60 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_arm
Chris@16 61
Chris@16 62 #elif defined(__GNUC__) && defined(__sparc_v9__)
Chris@16 63
Chris@101 64 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_sparc
Chris@101 65
Chris@101 66 #elif defined(__GNUC__) && defined(__alpha__)
Chris@101 67
Chris@101 68 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_alpha
Chris@101 69
Chris@101 70 #elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 401) &&\
Chris@101 71 (\
Chris@101 72 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1) ||\
Chris@101 73 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) ||\
Chris@101 74 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) ||\
Chris@101 75 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) ||\
Chris@101 76 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)\
Chris@101 77 )
Chris@101 78
Chris@101 79 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_sync
Chris@101 80
Chris@101 81 #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64))
Chris@101 82
Chris@101 83 #define BOOST_ATOMIC_DETAIL_PLATFORM msvc_x86
Chris@101 84
Chris@101 85 #elif defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_M_ARM)
Chris@101 86
Chris@101 87 #define BOOST_ATOMIC_DETAIL_PLATFORM msvc_arm
Chris@101 88
Chris@101 89 #endif
Chris@101 90
Chris@101 91 // OS-based backends
Chris@101 92 #if !defined(BOOST_ATOMIC_DETAIL_PLATFORM)
Chris@101 93
Chris@101 94 #if defined(__linux__) && defined(__arm__)
Chris@101 95
Chris@101 96 #define BOOST_ATOMIC_DETAIL_PLATFORM linux_arm
Chris@16 97
Chris@16 98 #elif defined(BOOST_WINDOWS) || defined(_WIN32_CE)
Chris@16 99
Chris@101 100 #define BOOST_ATOMIC_DETAIL_PLATFORM windows
Chris@16 101
Chris@16 102 #endif
Chris@16 103
Chris@101 104 #endif // !defined(BOOST_ATOMIC_DETAIL_PLATFORM)
Chris@101 105
Chris@101 106 #endif // !defined(BOOST_ATOMIC_FORCE_FALLBACK)
Chris@101 107
Chris@101 108 #if !defined(BOOST_ATOMIC_DETAIL_PLATFORM)
Chris@101 109 #define BOOST_ATOMIC_DETAIL_PLATFORM emulated
Chris@101 110 #define BOOST_ATOMIC_EMULATED
Chris@16 111 #endif
Chris@101 112
Chris@101 113 #define BOOST_ATOMIC_DETAIL_HEADER(prefix) <BOOST_JOIN(prefix, BOOST_ATOMIC_DETAIL_PLATFORM).hpp>
Chris@101 114
Chris@101 115 #endif // BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_