Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/atomic/detail/platform.hpp @ 101:c530137014c0
Update Boost headers (1.58.0)
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:12:49 +0100 |
parents | 2665513ce2d3 |
children |
comparison
equal
deleted
inserted
replaced
100:793467b5e61c | 101:c530137014c0 |
---|---|
1 #ifndef BOOST_ATOMIC_DETAIL_PLATFORM_HPP | 1 /* |
2 #define BOOST_ATOMIC_DETAIL_PLATFORM_HPP | 2 * Distributed under the Boost Software License, Version 1.0. |
3 * (See accompanying file LICENSE_1_0.txt or copy at | |
4 * http://www.boost.org/LICENSE_1_0.txt) | |
5 * | |
6 * Copyright (c) 2009 Helge Bahmann | |
7 * Copyright (c) 2014 Andrey Semashev | |
8 */ | |
9 /*! | |
10 * \file atomic/detail/platform.hpp | |
11 * | |
12 * This header defines macros for the target platform detection | |
13 */ | |
3 | 14 |
4 // Copyright (c) 2009 Helge Bahmann | 15 #ifndef BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_ |
5 // | 16 #define BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_ |
6 // Distributed under the Boost Software License, Version 1.0. | |
7 // See accompanying file LICENSE_1_0.txt or copy at | |
8 // http://www.boost.org/LICENSE_1_0.txt) | |
9 | |
10 // Platform selection file | |
11 | 17 |
12 #include <boost/atomic/detail/config.hpp> | 18 #include <boost/atomic/detail/config.hpp> |
13 | 19 |
14 #ifdef BOOST_HAS_PRAGMA_ONCE | 20 #ifdef BOOST_HAS_PRAGMA_ONCE |
15 #pragma once | 21 #pragma once |
16 #endif | 22 #endif |
17 | 23 |
18 // Intel compiler does not support __atomic* intrinsics properly, although defines them (tested with 13.0.1 and 13.1.1 on Linux) | 24 #if !defined(BOOST_ATOMIC_FORCE_FALLBACK) |
19 #if (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407) && !defined(BOOST_INTEL_CXX_VERSION))\ | |
20 || (defined(BOOST_CLANG) && ((__clang_major__ * 100 + __clang_minor__) >= 302)) | |
21 | 25 |
22 #include <boost/atomic/detail/gcc-atomic.hpp> | 26 // Compiler-based backends |
27 #if ((defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407)) ||\ | |
28 (defined(BOOST_CLANG) && ((__clang_major__ * 100 + __clang_minor__) >= 302))) &&\ | |
29 (\ | |
30 (__GCC_ATOMIC_BOOL_LOCK_FREE + 0) == 2 ||\ | |
31 (__GCC_ATOMIC_CHAR_LOCK_FREE + 0) == 2 ||\ | |
32 (__GCC_ATOMIC_SHORT_LOCK_FREE + 0) == 2 ||\ | |
33 (__GCC_ATOMIC_INT_LOCK_FREE + 0) == 2 ||\ | |
34 (__GCC_ATOMIC_LONG_LOCK_FREE + 0) == 2 ||\ | |
35 (__GCC_ATOMIC_LLONG_LOCK_FREE + 0) == 2\ | |
36 ) | |
37 | |
38 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_atomic | |
23 | 39 |
24 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) | 40 #elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) |
25 | 41 |
26 #include <boost/atomic/detail/gcc-x86.hpp> | 42 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_x86 |
27 | |
28 #elif 0 && defined(__GNUC__) && defined(__alpha__) /* currently does not work correctly */ | |
29 | |
30 #include <boost/atomic/detail/base.hpp> | |
31 #include <boost/atomic/detail/gcc-alpha.hpp> | |
32 | 43 |
33 #elif defined(__GNUC__) && (defined(__POWERPC__) || defined(__PPC__)) | 44 #elif defined(__GNUC__) && (defined(__POWERPC__) || defined(__PPC__)) |
34 | 45 |
35 #include <boost/atomic/detail/gcc-ppc.hpp> | 46 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_ppc |
36 | 47 |
37 // This list of ARM architecture versions comes from Apple's arm/arch.h header. | 48 // This list of ARM architecture versions comes from Apple's arm/arch.h header. |
38 // I don't know how complete it is. | 49 // I don't know how complete it is. |
39 #elif defined(__GNUC__) && (defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) \ | 50 #elif defined(__GNUC__) &&\ |
40 || defined(__ARM_ARCH_6Z__) || defined(__ARM_ARCH_6ZK__) \ | 51 (\ |
41 || defined(__ARM_ARCH_6K__) \ | 52 defined(__ARM_ARCH_6__) || defined(__ARM_ARCH_6J__) ||\ |
42 || defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) \ | 53 defined(__ARM_ARCH_6K__) || defined(__ARM_ARCH_6Z__) ||\ |
43 || defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) \ | 54 defined(__ARM_ARCH_6ZK__) ||\ |
44 || defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__)) | 55 defined(__ARM_ARCH_7__) || defined(__ARM_ARCH_7A__) ||\ |
56 defined(__ARM_ARCH_7R__) || defined(__ARM_ARCH_7M__) ||\ | |
57 defined(__ARM_ARCH_7EM__) || defined(__ARM_ARCH_7S__)\ | |
58 ) | |
45 | 59 |
46 #include <boost/atomic/detail/gcc-armv6plus.hpp> | 60 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_arm |
47 | |
48 #elif defined(__linux__) && defined(__arm__) | |
49 | |
50 #include <boost/atomic/detail/linux-arm.hpp> | |
51 | 61 |
52 #elif defined(__GNUC__) && defined(__sparc_v9__) | 62 #elif defined(__GNUC__) && defined(__sparc_v9__) |
53 | 63 |
54 #include <boost/atomic/detail/gcc-sparcv9.hpp> | 64 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_sparc |
65 | |
66 #elif defined(__GNUC__) && defined(__alpha__) | |
67 | |
68 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_alpha | |
69 | |
70 #elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 401) &&\ | |
71 (\ | |
72 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1) ||\ | |
73 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) ||\ | |
74 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) ||\ | |
75 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) ||\ | |
76 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16)\ | |
77 ) | |
78 | |
79 #define BOOST_ATOMIC_DETAIL_PLATFORM gcc_sync | |
80 | |
81 #elif defined(_MSC_VER) && (defined(_M_IX86) || defined(_M_X64)) | |
82 | |
83 #define BOOST_ATOMIC_DETAIL_PLATFORM msvc_x86 | |
84 | |
85 #elif defined(_MSC_VER) && _MSC_VER >= 1700 && defined(_M_ARM) | |
86 | |
87 #define BOOST_ATOMIC_DETAIL_PLATFORM msvc_arm | |
88 | |
89 #endif | |
90 | |
91 // OS-based backends | |
92 #if !defined(BOOST_ATOMIC_DETAIL_PLATFORM) | |
93 | |
94 #if defined(__linux__) && defined(__arm__) | |
95 | |
96 #define BOOST_ATOMIC_DETAIL_PLATFORM linux_arm | |
55 | 97 |
56 #elif defined(BOOST_WINDOWS) || defined(_WIN32_CE) | 98 #elif defined(BOOST_WINDOWS) || defined(_WIN32_CE) |
57 | 99 |
58 #include <boost/atomic/detail/windows.hpp> | 100 #define BOOST_ATOMIC_DETAIL_PLATFORM windows |
59 | |
60 #elif 0 && defined(__GNUC__) /* currently does not work correctly */ | |
61 | |
62 #include <boost/atomic/detail/base.hpp> | |
63 #include <boost/atomic/detail/gcc-cas.hpp> | |
64 | |
65 #else | |
66 | |
67 #include <boost/atomic/detail/base.hpp> | |
68 | 101 |
69 #endif | 102 #endif |
70 | 103 |
104 #endif // !defined(BOOST_ATOMIC_DETAIL_PLATFORM) | |
105 | |
106 #endif // !defined(BOOST_ATOMIC_FORCE_FALLBACK) | |
107 | |
108 #if !defined(BOOST_ATOMIC_DETAIL_PLATFORM) | |
109 #define BOOST_ATOMIC_DETAIL_PLATFORM emulated | |
110 #define BOOST_ATOMIC_EMULATED | |
71 #endif | 111 #endif |
112 | |
113 #define BOOST_ATOMIC_DETAIL_HEADER(prefix) <BOOST_JOIN(prefix, BOOST_ATOMIC_DETAIL_PLATFORM).hpp> | |
114 | |
115 #endif // BOOST_ATOMIC_DETAIL_PLATFORM_HPP_INCLUDED_ |