]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | ////////////////////////////////////////////////////////////////////////////// |
2 | // | |
3 | // (C) Copyright Ion Gaztanaga 2005-2013. Distributed under the Boost | |
4 | // Software License, Version 1.0. (See accompanying file | |
5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | // | |
7 | // See http://www.boost.org/libs/container for documentation. | |
8 | // | |
9 | ////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP | |
12 | #define BOOST_CONTAINER_DETAIL_WORKAROUND_HPP | |
13 | ||
14 | #ifndef BOOST_CONFIG_HPP | |
15 | # include <boost/config.hpp> | |
16 | #endif | |
17 | ||
18 | #if defined(BOOST_HAS_PRAGMA_ONCE) | |
19 | # pragma once | |
20 | #endif | |
21 | ||
22 | #if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)\ | |
23 | && !defined(BOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL) | |
24 | #define BOOST_CONTAINER_PERFECT_FORWARDING | |
25 | #endif | |
26 | ||
27 | #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(__GXX_EXPERIMENTAL_CXX0X__)\ | |
28 | && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40700) | |
29 | #define BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST | |
30 | #endif | |
31 | ||
32 | #if defined(BOOST_GCC_VERSION) | |
33 | # if (BOOST_GCC_VERSION < 40700) || !defined(BOOST_GCC_CXX11) | |
34 | # define BOOST_CONTAINER_NO_CXX11_DELEGATING_CONSTRUCTORS | |
35 | # endif | |
36 | #elif defined(BOOST_MSVC) | |
37 | # if _MSC_FULL_VER < 180020827 | |
38 | # define BOOST_CONTAINER_NO_CXX11_DELEGATING_CONSTRUCTORS | |
39 | # endif | |
40 | #elif defined(BOOST_CLANG) | |
41 | # if !__has_feature(cxx_delegating_constructors) | |
42 | # define BOOST_CONTAINER_NO_CXX11_DELEGATING_CONSTRUCTORS | |
43 | # endif | |
44 | #endif | |
45 | ||
b32b8144 FG |
46 | #if defined(BOOST_MSVC) && (_MSC_VER < 1400) |
47 | #define BOOST_CONTAINER_TEMPLATED_CONVERSION_OPERATOR_BROKEN | |
7c673cae FG |
48 | #endif |
49 | ||
50 | #if !defined(BOOST_NO_CXX11_HDR_TUPLE) || (defined(BOOST_MSVC) && (BOOST_MSVC == 1700 || BOOST_MSVC == 1600)) | |
51 | #define BOOST_CONTAINER_PAIR_TEST_HAS_HEADER_TUPLE | |
52 | #endif | |
53 | ||
54 | //Macros for documentation purposes. For code, expands to the argument | |
55 | #define BOOST_CONTAINER_IMPDEF(TYPE) TYPE | |
56 | #define BOOST_CONTAINER_SEEDOC(TYPE) TYPE | |
57 | ||
58 | //Macros for memset optimization. In most platforms | |
59 | //memsetting pointers and floatings is safe and faster. | |
60 | // | |
61 | //If your platform does not offer these guarantees | |
62 | //define these to value zero. | |
63 | #ifndef BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_NOT_ZERO | |
64 | #define BOOST_CONTAINER_MEMZEROED_FLOATING_POINT_IS_ZERO 1 | |
65 | #endif | |
66 | ||
67 | #ifndef BOOST_CONTAINER_MEMZEROED_POINTER_IS_NOT_NULL | |
68 | #define BOOST_CONTAINER_MEMZEROED_POINTER_IS_NULL | |
69 | #endif | |
70 | ||
71 | #define BOOST_CONTAINER_DOC1ST(TYPE1, TYPE2) TYPE2 | |
72 | #define BOOST_CONTAINER_I , | |
73 | #define BOOST_CONTAINER_DOCIGN(T) T | |
74 | #define BOOST_CONTAINER_DOCONLY(T) | |
75 | ||
76 | /* | |
77 | we need to import/export our code only if the user has specifically | |
78 | asked for it by defining either BOOST_ALL_DYN_LINK if they want all boost | |
79 | libraries to be dynamically linked, or BOOST_CONTAINER_DYN_LINK | |
80 | if they want just this one to be dynamically liked: | |
81 | */ | |
82 | #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTAINER_DYN_LINK) | |
83 | ||
84 | /* export if this is our own source, otherwise import: */ | |
85 | #ifdef BOOST_CONTAINER_SOURCE | |
86 | # define BOOST_CONTAINER_DECL BOOST_SYMBOL_EXPORT | |
87 | #else | |
88 | # define BOOST_CONTAINER_DECL BOOST_SYMBOL_IMPORT | |
89 | ||
90 | #endif /* BOOST_CONTAINER_SOURCE */ | |
91 | #else | |
92 | #define BOOST_CONTAINER_DECL | |
93 | #endif /* DYN_LINK */ | |
94 | ||
95 | //#define BOOST_CONTAINER_DISABLE_FORCEINLINE | |
96 | ||
97 | #if defined(BOOST_CONTAINER_DISABLE_FORCEINLINE) | |
98 | #define BOOST_CONTAINER_FORCEINLINE inline | |
99 | #elif defined(BOOST_CONTAINER_FORCEINLINE_IS_BOOST_FORCELINE) | |
100 | #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE | |
1e59de90 TL |
101 | #elif defined(BOOST_MSVC) && (_MSC_VER < 1900 || defined(_DEBUG)) |
102 | //"__forceinline" and MSVC seems to have some bugs in old versions and in debug mode | |
7c673cae | 103 | #define BOOST_CONTAINER_FORCEINLINE inline |
1e59de90 TL |
104 | //#elif defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ < 5))) |
105 | #elif defined(__GNUC__) && (__GNUC__ <= 5) | |
b32b8144 FG |
106 | //Older GCCs have problems with forceinline |
107 | #define BOOST_CONTAINER_FORCEINLINE inline | |
7c673cae FG |
108 | #else |
109 | #define BOOST_CONTAINER_FORCEINLINE BOOST_FORCEINLINE | |
110 | #endif | |
111 | ||
20effc67 TL |
112 | //#define BOOST_CONTAINER_DISABLE_NOINLINE |
113 | ||
114 | #if defined(BOOST_CONTAINER_DISABLE_NOINLINE) | |
115 | #define BOOST_CONTAINER_NOINLINE | |
116 | #else | |
117 | #define BOOST_CONTAINER_NOINLINE BOOST_NOINLINE | |
118 | #endif | |
119 | ||
120 | ||
92f5a8d4 TL |
121 | #if !defined(__has_feature) |
122 | #define BOOST_CONTAINER_HAS_FEATURE(feature) 0 | |
123 | #else | |
124 | #define BOOST_CONTAINER_HAS_FEATURE(feature) __has_feature(feature) | |
125 | #endif | |
126 | ||
127 | //Detect address sanitizer | |
128 | #if defined(__SANITIZE_ADDRESS__) || BOOST_CONTAINER_HAS_FEATURE(address_sanitizer) | |
129 | #define BOOST_CONTAINER_ASAN | |
130 | #endif | |
131 | ||
132 | ||
1e59de90 | 133 | #if (BOOST_CXX_VERSION < 201703L) || !defined(__cpp_deduction_guides) |
92f5a8d4 TL |
134 | #define BOOST_CONTAINER_NO_CXX17_CTAD |
135 | #endif | |
136 | ||
1e59de90 TL |
137 | #if defined(BOOST_CONTAINER_DISABLE_ATTRIBUTE_NODISCARD) |
138 | #define BOOST_CONTAINER_ATTRIBUTE_NODISCARD | |
139 | #else | |
140 | #if defined(BOOST_GCC) && ((BOOST_GCC < 100000) || (__cplusplus < 201703L)) | |
141 | //Avoid using it in C++ < 17 and GCC < 10 because it warns in SFINAE contexts | |
142 | //(see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89070) | |
143 | #define BOOST_CONTAINER_ATTRIBUTE_NODISCARD | |
144 | #else | |
145 | #define BOOST_CONTAINER_ATTRIBUTE_NODISCARD BOOST_ATTRIBUTE_NODISCARD | |
146 | #endif | |
147 | #endif | |
148 | ||
149 | ||
150 | //Configuration options: | |
151 | ||
152 | //Define this to use std exception types instead of boost::container's own exception types | |
153 | //#define BOOST_CONTAINER_USE_STD_EXCEPTIONS | |
154 | ||
155 | ||
156 | ||
157 | ||
7c673cae | 158 | #endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP |