Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 1 | // Boost config.hpp configuration header file ------------------------------// |
| 2 | // boostinspect:ndprecated_macros -- tell the inspect tool to ignore this file |
| 3 | |
| 4 | // Copyright (c) 2001-2003 John Maddock |
| 5 | // Copyright (c) 2001 Darin Adler |
| 6 | // Copyright (c) 2001 Peter Dimov |
| 7 | // Copyright (c) 2002 Bill Kempf |
| 8 | // Copyright (c) 2002 Jens Maurer |
| 9 | // Copyright (c) 2002-2003 David Abrahams |
| 10 | // Copyright (c) 2003 Gennaro Prota |
| 11 | // Copyright (c) 2003 Eric Friedman |
| 12 | // Copyright (c) 2010 Eric Jourdanneau, Joel Falcou |
| 13 | // Distributed under the Boost Software License, Version 1.0. (See |
| 14 | // accompanying file LICENSE_1_0.txt or copy at |
| 15 | // http://www.boost.org/LICENSE_1_0.txt) |
| 16 | |
| 17 | // See http://www.boost.org/ for most recent version. |
| 18 | |
| 19 | // Boost config.hpp policy and rationale documentation has been moved to |
| 20 | // http://www.boost.org/libs/config/ |
| 21 | // |
| 22 | // This file is intended to be stable, and relatively unchanging. |
| 23 | // It should contain boilerplate code only - no compiler specific |
| 24 | // code unless it is unavoidable - no changes unless unavoidable. |
| 25 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 26 | #ifndef NDNBOOST_CONFIG_SUFFIX_HPP |
| 27 | #define NDNBOOST_CONFIG_SUFFIX_HPP |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 28 | |
| 29 | #if defined(__GNUC__) && (__GNUC__ >= 4) |
| 30 | // |
| 31 | // Some GCC-4.x versions issue warnings even when __extension__ is used, |
| 32 | // so use this as a workaround: |
| 33 | // |
| 34 | #pragma GCC system_header |
| 35 | #endif |
| 36 | |
| 37 | // |
| 38 | // ensure that visibility macros are always defined, thus symplifying use |
| 39 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 40 | #ifndef NDNBOOST_SYMBOL_EXPORT |
| 41 | # define NDNBOOST_SYMBOL_EXPORT |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 42 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 43 | #ifndef NDNBOOST_SYMBOL_IMPORT |
| 44 | # define NDNBOOST_SYMBOL_IMPORT |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 45 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 46 | #ifndef NDNBOOST_SYMBOL_VISIBLE |
| 47 | # define NDNBOOST_SYMBOL_VISIBLE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 48 | #endif |
| 49 | |
| 50 | // |
| 51 | // look for long long by looking for the appropriate macros in <limits.h>. |
| 52 | // Note that we use limits.h rather than climits for maximal portability, |
| 53 | // remember that since these just declare a bunch of macros, there should be |
| 54 | // no namespace issues from this. |
| 55 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 56 | #if !defined(NDNBOOST_HAS_LONG_LONG) && !defined(NDNBOOST_NO_LONG_LONG) \ |
| 57 | && !defined(NDNBOOST_MSVC) && !defined(__BORLANDC__) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 58 | # include <limits.h> |
| 59 | # if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 60 | # define NDNBOOST_HAS_LONG_LONG |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 61 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 62 | # define NDNBOOST_NO_LONG_LONG |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 63 | # endif |
| 64 | #endif |
| 65 | |
| 66 | // GCC 3.x will clean up all of those nasty macro definitions that |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 67 | // NDNBOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 68 | // it under GCC 3.x. |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 69 | #if defined(__GNUC__) && (__GNUC__ >= 3) && defined(NDNBOOST_NO_CTYPE_FUNCTIONS) |
| 70 | # undef NDNBOOST_NO_CTYPE_FUNCTIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 71 | #endif |
| 72 | |
| 73 | // |
| 74 | // Assume any extensions are in namespace std:: unless stated otherwise: |
| 75 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 76 | # ifndef NDNBOOST_STD_EXTENSION_NAMESPACE |
| 77 | # define NDNBOOST_STD_EXTENSION_NAMESPACE std |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 78 | # endif |
| 79 | |
| 80 | // |
| 81 | // If cv-qualified specializations are not allowed, then neither are cv-void ones: |
| 82 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 83 | # if defined(NDNBOOST_NO_CV_SPECIALIZATIONS) \ |
| 84 | && !defined(NDNBOOST_NO_CV_VOID_SPECIALIZATIONS) |
| 85 | # define NDNBOOST_NO_CV_VOID_SPECIALIZATIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 86 | # endif |
| 87 | |
| 88 | // |
| 89 | // If there is no numeric_limits template, then it can't have any compile time |
| 90 | // constants either! |
| 91 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 92 | # if defined(NDNBOOST_NO_LIMITS) \ |
| 93 | && !defined(NDNBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) |
| 94 | # define NDNBOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS |
| 95 | # define NDNBOOST_NO_MS_INT64_NUMERIC_LIMITS |
| 96 | # define NDNBOOST_NO_LONG_LONG_NUMERIC_LIMITS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 97 | # endif |
| 98 | |
| 99 | // |
| 100 | // if there is no long long then there is no specialisation |
| 101 | // for numeric_limits<long long> either: |
| 102 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 103 | #if !defined(NDNBOOST_HAS_LONG_LONG) && !defined(NDNBOOST_NO_LONG_LONG_NUMERIC_LIMITS) |
| 104 | # define NDNBOOST_NO_LONG_LONG_NUMERIC_LIMITS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 105 | #endif |
| 106 | |
| 107 | // |
| 108 | // if there is no __int64 then there is no specialisation |
| 109 | // for numeric_limits<__int64> either: |
| 110 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 111 | #if !defined(NDNBOOST_HAS_MS_INT64) && !defined(NDNBOOST_NO_MS_INT64_NUMERIC_LIMITS) |
| 112 | # define NDNBOOST_NO_MS_INT64_NUMERIC_LIMITS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 113 | #endif |
| 114 | |
| 115 | // |
| 116 | // if member templates are supported then so is the |
| 117 | // VC6 subset of member templates: |
| 118 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 119 | # if !defined(NDNBOOST_NO_MEMBER_TEMPLATES) \ |
| 120 | && !defined(NDNBOOST_MSVC6_MEMBER_TEMPLATES) |
| 121 | # define NDNBOOST_MSVC6_MEMBER_TEMPLATES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 122 | # endif |
| 123 | |
| 124 | // |
| 125 | // Without partial specialization, can't test for partial specialisation bugs: |
| 126 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 127 | # if defined(NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ |
| 128 | && !defined(NDNBOOST_BCB_PARTIAL_SPECIALIZATION_BUG) |
| 129 | # define NDNBOOST_BCB_PARTIAL_SPECIALIZATION_BUG |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 130 | # endif |
| 131 | |
| 132 | // |
| 133 | // Without partial specialization, we can't have array-type partial specialisations: |
| 134 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 135 | # if defined(NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ |
| 136 | && !defined(NDNBOOST_NO_ARRAY_TYPE_SPECIALIZATIONS) |
| 137 | # define NDNBOOST_NO_ARRAY_TYPE_SPECIALIZATIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 138 | # endif |
| 139 | |
| 140 | // |
| 141 | // Without partial specialization, std::iterator_traits can't work: |
| 142 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 143 | # if defined(NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ |
| 144 | && !defined(NDNBOOST_NO_STD_ITERATOR_TRAITS) |
| 145 | # define NDNBOOST_NO_STD_ITERATOR_TRAITS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 146 | # endif |
| 147 | |
| 148 | // |
| 149 | // Without partial specialization, partial |
| 150 | // specialization with default args won't work either: |
| 151 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 152 | # if defined(NDNBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \ |
| 153 | && !defined(NDNBOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) |
| 154 | # define NDNBOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 155 | # endif |
| 156 | |
| 157 | // |
| 158 | // Without member template support, we can't have template constructors |
| 159 | // in the standard library either: |
| 160 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 161 | # if defined(NDNBOOST_NO_MEMBER_TEMPLATES) \ |
| 162 | && !defined(NDNBOOST_MSVC6_MEMBER_TEMPLATES) \ |
| 163 | && !defined(NDNBOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS) |
| 164 | # define NDNBOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 165 | # endif |
| 166 | |
| 167 | // |
| 168 | // Without member template support, we can't have a conforming |
| 169 | // std::allocator template either: |
| 170 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 171 | # if defined(NDNBOOST_NO_MEMBER_TEMPLATES) \ |
| 172 | && !defined(NDNBOOST_MSVC6_MEMBER_TEMPLATES) \ |
| 173 | && !defined(NDNBOOST_NO_STD_ALLOCATOR) |
| 174 | # define NDNBOOST_NO_STD_ALLOCATOR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 175 | # endif |
| 176 | |
| 177 | // |
| 178 | // without ADL support then using declarations will break ADL as well: |
| 179 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 180 | #if defined(NDNBOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) && !defined(NDNBOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL) |
| 181 | # define NDNBOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 182 | #endif |
| 183 | |
| 184 | // |
| 185 | // Without typeid support we have no dynamic RTTI either: |
| 186 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 187 | #if defined(NDNBOOST_NO_TYPEID) && !defined(NDNBOOST_NO_RTTI) |
| 188 | # define NDNBOOST_NO_RTTI |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 189 | #endif |
| 190 | |
| 191 | // |
| 192 | // If we have a standard allocator, then we have a partial one as well: |
| 193 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 194 | #if !defined(NDNBOOST_NO_STD_ALLOCATOR) |
| 195 | # define NDNBOOST_HAS_PARTIAL_STD_ALLOCATOR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 196 | #endif |
| 197 | |
| 198 | // |
| 199 | // We can't have a working std::use_facet if there is no std::locale: |
| 200 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 201 | # if defined(NDNBOOST_NO_STD_LOCALE) && !defined(NDNBOOST_NO_STD_USE_FACET) |
| 202 | # define NDNBOOST_NO_STD_USE_FACET |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 203 | # endif |
| 204 | |
| 205 | // |
| 206 | // We can't have a std::messages facet if there is no std::locale: |
| 207 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 208 | # if defined(NDNBOOST_NO_STD_LOCALE) && !defined(NDNBOOST_NO_STD_MESSAGES) |
| 209 | # define NDNBOOST_NO_STD_MESSAGES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 210 | # endif |
| 211 | |
| 212 | // |
| 213 | // We can't have a working std::wstreambuf if there is no std::locale: |
| 214 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 215 | # if defined(NDNBOOST_NO_STD_LOCALE) && !defined(NDNBOOST_NO_STD_WSTREAMBUF) |
| 216 | # define NDNBOOST_NO_STD_WSTREAMBUF |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 217 | # endif |
| 218 | |
| 219 | // |
| 220 | // We can't have a <cwctype> if there is no <cwchar>: |
| 221 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 222 | # if defined(NDNBOOST_NO_CWCHAR) && !defined(NDNBOOST_NO_CWCTYPE) |
| 223 | # define NDNBOOST_NO_CWCTYPE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 224 | # endif |
| 225 | |
| 226 | // |
| 227 | // We can't have a swprintf if there is no <cwchar>: |
| 228 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 229 | # if defined(NDNBOOST_NO_CWCHAR) && !defined(NDNBOOST_NO_SWPRINTF) |
| 230 | # define NDNBOOST_NO_SWPRINTF |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 231 | # endif |
| 232 | |
| 233 | // |
| 234 | // If Win32 support is turned off, then we must turn off |
| 235 | // threading support also, unless there is some other |
| 236 | // thread API enabled: |
| 237 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 238 | #if defined(NDNBOOST_DISABLE_WIN32) && defined(_WIN32) \ |
| 239 | && !defined(NDNBOOST_DISABLE_THREADS) && !defined(NDNBOOST_HAS_PTHREADS) |
| 240 | # define NDNBOOST_DISABLE_THREADS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 241 | #endif |
| 242 | |
| 243 | // |
| 244 | // Turn on threading support if the compiler thinks that it's in |
| 245 | // multithreaded mode. We put this here because there are only a |
| 246 | // limited number of macros that identify this (if there's any missing |
| 247 | // from here then add to the appropriate compiler section): |
| 248 | // |
| 249 | #if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \ |
| 250 | || defined(_PTHREADS) || defined(__APPLE__) || defined(__DragonFly__)) \ |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 251 | && !defined(NDNBOOST_HAS_THREADS) |
| 252 | # define NDNBOOST_HAS_THREADS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 253 | #endif |
| 254 | |
| 255 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 256 | // Turn threading support off if NDNBOOST_DISABLE_THREADS is defined: |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 257 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 258 | #if defined(NDNBOOST_DISABLE_THREADS) && defined(NDNBOOST_HAS_THREADS) |
| 259 | # undef NDNBOOST_HAS_THREADS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 260 | #endif |
| 261 | |
| 262 | // |
| 263 | // Turn threading support off if we don't recognise the threading API: |
| 264 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 265 | #if defined(NDNBOOST_HAS_THREADS) && !defined(NDNBOOST_HAS_PTHREADS)\ |
| 266 | && !defined(NDNBOOST_HAS_WINTHREADS) && !defined(NDNBOOST_HAS_BETHREADS)\ |
| 267 | && !defined(NDNBOOST_HAS_MPTASKS) |
| 268 | # undef NDNBOOST_HAS_THREADS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 269 | #endif |
| 270 | |
| 271 | // |
| 272 | // Turn threading detail macros off if we don't (want to) use threading |
| 273 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 274 | #ifndef NDNBOOST_HAS_THREADS |
| 275 | # undef NDNBOOST_HAS_PTHREADS |
| 276 | # undef NDNBOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE |
| 277 | # undef NDNBOOST_HAS_PTHREAD_YIELD |
| 278 | # undef NDNBOOST_HAS_PTHREAD_DELAY_NP |
| 279 | # undef NDNBOOST_HAS_WINTHREADS |
| 280 | # undef NDNBOOST_HAS_BETHREADS |
| 281 | # undef NDNBOOST_HAS_MPTASKS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 282 | #endif |
| 283 | |
| 284 | // |
| 285 | // If the compiler claims to be C99 conformant, then it had better |
| 286 | // have a <stdint.h>: |
| 287 | // |
| 288 | # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 289 | # define NDNBOOST_HAS_STDINT_H |
| 290 | # ifndef NDNBOOST_HAS_LOG1P |
| 291 | # define NDNBOOST_HAS_LOG1P |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 292 | # endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 293 | # ifndef NDNBOOST_HAS_EXPM1 |
| 294 | # define NDNBOOST_HAS_EXPM1 |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 295 | # endif |
| 296 | # endif |
| 297 | |
| 298 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 299 | // Define NDNBOOST_NO_SLIST and NDNBOOST_NO_HASH if required. |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 300 | // Note that this is for backwards compatibility only. |
| 301 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 302 | # if !defined(NDNBOOST_HAS_SLIST) && !defined(NDNBOOST_NO_SLIST) |
| 303 | # define NDNBOOST_NO_SLIST |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 304 | # endif |
| 305 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 306 | # if !defined(NDNBOOST_HAS_HASH) && !defined(NDNBOOST_NO_HASH) |
| 307 | # define NDNBOOST_NO_HASH |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 308 | # endif |
| 309 | |
| 310 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 311 | // Set NDNBOOST_SLIST_HEADER if not set already: |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 312 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 313 | #if defined(NDNBOOST_HAS_SLIST) && !defined(NDNBOOST_SLIST_HEADER) |
| 314 | # define NDNBOOST_SLIST_HEADER <slist> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 315 | #endif |
| 316 | |
| 317 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 318 | // Set NDNBOOST_HASH_SET_HEADER if not set already: |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 319 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 320 | #if defined(NDNBOOST_HAS_HASH) && !defined(NDNBOOST_HASH_SET_HEADER) |
| 321 | # define NDNBOOST_HASH_SET_HEADER <hash_set> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 322 | #endif |
| 323 | |
| 324 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 325 | // Set NDNBOOST_HASH_MAP_HEADER if not set already: |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 326 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 327 | #if defined(NDNBOOST_HAS_HASH) && !defined(NDNBOOST_HASH_MAP_HEADER) |
| 328 | # define NDNBOOST_HASH_MAP_HEADER <hash_map> |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 329 | #endif |
| 330 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 331 | // NDNBOOST_HAS_ABI_HEADERS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 332 | // This macro gets set if we have headers that fix the ABI, |
| 333 | // and prevent ODR violations when linking to external libraries: |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 334 | #if defined(NDNBOOST_ABI_PREFIX) && defined(NDNBOOST_ABI_SUFFIX) && !defined(NDNBOOST_HAS_ABI_HEADERS) |
| 335 | # define NDNBOOST_HAS_ABI_HEADERS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 336 | #endif |
| 337 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 338 | #if defined(NDNBOOST_HAS_ABI_HEADERS) && defined(NDNBOOST_DISABLE_ABI_HEADERS) |
| 339 | # undef NDNBOOST_HAS_ABI_HEADERS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 340 | #endif |
| 341 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 342 | // NDNBOOST_NO_STDC_NAMESPACE workaround --------------------------------------// |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 343 | // Because std::size_t usage is so common, even in boost headers which do not |
| 344 | // otherwise use the C library, the <cstddef> workaround is included here so |
| 345 | // that ugly workaround code need not appear in many other boost headers. |
| 346 | // NOTE WELL: This is a workaround for non-conforming compilers; <cstddef> |
| 347 | // must still be #included in the usual places so that <cstddef> inclusion |
| 348 | // works as expected with standard conforming compilers. The resulting |
| 349 | // double inclusion of <cstddef> is harmless. |
| 350 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 351 | # if defined(NDNBOOST_NO_STDC_NAMESPACE) && defined(__cplusplus) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 352 | # include <cstddef> |
| 353 | namespace std { using ::ptrdiff_t; using ::size_t; } |
| 354 | # endif |
| 355 | |
| 356 | // Workaround for the unfortunate min/max macros defined by some platform headers |
| 357 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 358 | #define NDNBOOST_PREVENT_MACRO_SUBSTITUTION |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 359 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 360 | #ifndef NDNBOOST_USING_STD_MIN |
| 361 | # define NDNBOOST_USING_STD_MIN() using std::min |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 362 | #endif |
| 363 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 364 | #ifndef NDNBOOST_USING_STD_MAX |
| 365 | # define NDNBOOST_USING_STD_MAX() using std::max |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 366 | #endif |
| 367 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 368 | // NDNBOOST_NO_STD_MIN_MAX workaround -----------------------------------------// |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 369 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 370 | # if defined(NDNBOOST_NO_STD_MIN_MAX) && defined(__cplusplus) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 371 | |
| 372 | namespace std { |
| 373 | template <class _Tp> |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 374 | inline const _Tp& min NDNBOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) { |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 375 | return __b < __a ? __b : __a; |
| 376 | } |
| 377 | template <class _Tp> |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 378 | inline const _Tp& max NDNBOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) { |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 379 | return __a < __b ? __b : __a; |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | # endif |
| 384 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 385 | // NDNBOOST_STATIC_CONSTANT workaround --------------------------------------- // |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 386 | // On compilers which don't allow in-class initialization of static integral |
| 387 | // constant members, we must use enums as a workaround if we want the constants |
| 388 | // to be available at compile-time. This macro gives us a convenient way to |
| 389 | // declare such constants. |
| 390 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 391 | # ifdef NDNBOOST_NO_INCLASS_MEMBER_INITIALIZATION |
| 392 | # define NDNBOOST_STATIC_CONSTANT(type, assignment) enum { assignment } |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 393 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 394 | # define NDNBOOST_STATIC_CONSTANT(type, assignment) static const type assignment |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 395 | # endif |
| 396 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 397 | // NDNBOOST_USE_FACET / HAS_FACET workaround ----------------------------------// |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 398 | // When the standard library does not have a conforming std::use_facet there |
| 399 | // are various workarounds available, but they differ from library to library. |
| 400 | // The same problem occurs with has_facet. |
| 401 | // These macros provide a consistent way to access a locale's facets. |
| 402 | // Usage: |
| 403 | // replace |
| 404 | // std::use_facet<Type>(loc); |
| 405 | // with |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 406 | // NDNBOOST_USE_FACET(Type, loc); |
| 407 | // Note do not add a std:: prefix to the front of NDNBOOST_USE_FACET! |
| 408 | // Use for NDNBOOST_HAS_FACET is analogous. |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 409 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 410 | #if defined(NDNBOOST_NO_STD_USE_FACET) |
| 411 | # ifdef NDNBOOST_HAS_TWO_ARG_USE_FACET |
| 412 | # define NDNBOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0)) |
| 413 | # define NDNBOOST_HAS_FACET(Type, loc) std::has_facet(loc, static_cast<Type*>(0)) |
| 414 | # elif defined(NDNBOOST_HAS_MACRO_USE_FACET) |
| 415 | # define NDNBOOST_USE_FACET(Type, loc) std::_USE(loc, Type) |
| 416 | # define NDNBOOST_HAS_FACET(Type, loc) std::_HAS(loc, Type) |
| 417 | # elif defined(NDNBOOST_HAS_STLP_USE_FACET) |
| 418 | # define NDNBOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc)) |
| 419 | # define NDNBOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 420 | # endif |
| 421 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 422 | # define NDNBOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc) |
| 423 | # define NDNBOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 424 | #endif |
| 425 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 426 | // NDNBOOST_NESTED_TEMPLATE workaround ------------------------------------------// |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 427 | // Member templates are supported by some compilers even though they can't use |
| 428 | // the A::template member<U> syntax, as a workaround replace: |
| 429 | // |
| 430 | // typedef typename A::template rebind<U> binder; |
| 431 | // |
| 432 | // with: |
| 433 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 434 | // typedef typename A::NDNBOOST_NESTED_TEMPLATE rebind<U> binder; |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 435 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 436 | #ifndef NDNBOOST_NO_MEMBER_TEMPLATE_KEYWORD |
| 437 | # define NDNBOOST_NESTED_TEMPLATE template |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 438 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 439 | # define NDNBOOST_NESTED_TEMPLATE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 440 | #endif |
| 441 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 442 | // NDNBOOST_UNREACHABLE_RETURN(x) workaround -------------------------------------// |
| 443 | // Normally evaluates to nothing, unless NDNBOOST_NO_UNREACHABLE_RETURN_DETECTION |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 444 | // is defined, in which case it evaluates to return x; Use when you have a return |
| 445 | // statement that can never be reached. |
| 446 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 447 | #ifdef NDNBOOST_NO_UNREACHABLE_RETURN_DETECTION |
| 448 | # define NDNBOOST_UNREACHABLE_RETURN(x) return x; |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 449 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 450 | # define NDNBOOST_UNREACHABLE_RETURN(x) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 451 | #endif |
| 452 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 453 | // NDNBOOST_DEDUCED_TYPENAME workaround ------------------------------------------// |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 454 | // |
| 455 | // Some compilers don't support the use of `typename' for dependent |
| 456 | // types in deduced contexts, e.g. |
| 457 | // |
| 458 | // template <class T> void f(T, typename T::type); |
| 459 | // ^^^^^^^^ |
| 460 | // Replace these declarations with: |
| 461 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 462 | // template <class T> void f(T, NDNBOOST_DEDUCED_TYPENAME T::type); |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 463 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 464 | #ifndef NDNBOOST_NO_DEDUCED_TYPENAME |
| 465 | # define NDNBOOST_DEDUCED_TYPENAME typename |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 466 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 467 | # define NDNBOOST_DEDUCED_TYPENAME |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 468 | #endif |
| 469 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 470 | #ifndef NDNBOOST_NO_TYPENAME_WITH_CTOR |
| 471 | # define NDNBOOST_CTOR_TYPENAME typename |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 472 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 473 | # define NDNBOOST_CTOR_TYPENAME |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 474 | #endif |
| 475 | |
| 476 | // long long workaround ------------------------------------------// |
| 477 | // On gcc (and maybe other compilers?) long long is alway supported |
| 478 | // but it's use may generate either warnings (with -ansi), or errors |
| 479 | // (with -pedantic -ansi) unless it's use is prefixed by __extension__ |
| 480 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 481 | #if defined(NDNBOOST_HAS_LONG_LONG) && defined(__cplusplus) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 482 | namespace ndnboost{ |
| 483 | # ifdef __GNUC__ |
| 484 | __extension__ typedef long long long_long_type; |
| 485 | __extension__ typedef unsigned long long ulong_long_type; |
| 486 | # else |
| 487 | typedef long long long_long_type; |
| 488 | typedef unsigned long long ulong_long_type; |
| 489 | # endif |
| 490 | } |
| 491 | #endif |
| 492 | // same again for __int128: |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 493 | #if defined(NDNBOOST_HAS_INT128) && defined(__cplusplus) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 494 | namespace ndnboost{ |
| 495 | # ifdef __GNUC__ |
| 496 | __extension__ typedef __int128 int128_type; |
| 497 | __extension__ typedef unsigned __int128 uint128_type; |
| 498 | # else |
| 499 | typedef __int128 int128_type; |
| 500 | typedef unsigned __int128 uint128_type; |
| 501 | # endif |
| 502 | } |
| 503 | #endif |
| 504 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 505 | // NDNBOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------// |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 506 | // |
| 507 | // Some compilers have problems with function templates whose template |
| 508 | // parameters don't appear in the function parameter list (basically |
| 509 | // they just link one instantiation of the template in the final |
| 510 | // executable). These macros provide a uniform way to cope with the |
| 511 | // problem with no effects on the calling syntax. |
| 512 | |
| 513 | // Example: |
| 514 | // |
| 515 | // #include <iostream> |
| 516 | // #include <ostream> |
| 517 | // #include <typeinfo> |
| 518 | // |
| 519 | // template <int n> |
| 520 | // void f() { std::cout << n << ' '; } |
| 521 | // |
| 522 | // template <typename T> |
| 523 | // void g() { std::cout << typeid(T).name() << ' '; } |
| 524 | // |
| 525 | // int main() { |
| 526 | // f<1>(); |
| 527 | // f<2>(); |
| 528 | // |
| 529 | // g<int>(); |
| 530 | // g<double>(); |
| 531 | // } |
| 532 | // |
| 533 | // With VC++ 6.0 the output is: |
| 534 | // |
| 535 | // 2 2 double double |
| 536 | // |
| 537 | // To fix it, write |
| 538 | // |
| 539 | // template <int n> |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 540 | // void f(NDNBOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... } |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 541 | // |
| 542 | // template <typename T> |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 543 | // void g(NDNBOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... } |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 544 | // |
| 545 | |
| 546 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 547 | #if defined(NDNBOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && defined(__cplusplus) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 548 | |
Jeff Thompson | 2277ce5 | 2013-08-01 17:34:11 -0700 | [diff] [blame] | 549 | # include "ndnboost/type.hpp" |
| 550 | # include "ndnboost/non_type.hpp" |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 551 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 552 | # define NDNBOOST_EXPLICIT_TEMPLATE_TYPE(t) ndnboost::type<t>* = 0 |
| 553 | # define NDNBOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) ndnboost::type<t>* |
| 554 | # define NDNBOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) ndnboost::non_type<t, v>* = 0 |
| 555 | # define NDNBOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) ndnboost::non_type<t, v>* |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 556 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 557 | # define NDNBOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \ |
| 558 | , NDNBOOST_EXPLICIT_TEMPLATE_TYPE(t) |
| 559 | # define NDNBOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \ |
| 560 | , NDNBOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) |
| 561 | # define NDNBOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \ |
| 562 | , NDNBOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) |
| 563 | # define NDNBOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \ |
| 564 | , NDNBOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 565 | |
| 566 | #else |
| 567 | |
| 568 | // no workaround needed: expand to nothing |
| 569 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 570 | # define NDNBOOST_EXPLICIT_TEMPLATE_TYPE(t) |
| 571 | # define NDNBOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t) |
| 572 | # define NDNBOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v) |
| 573 | # define NDNBOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 574 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 575 | # define NDNBOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t) |
| 576 | # define NDNBOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) |
| 577 | # define NDNBOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) |
| 578 | # define NDNBOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 579 | |
| 580 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 581 | #endif // defined NDNBOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 582 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 583 | // When NDNBOOST_NO_STD_TYPEINFO is defined, we can just import |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 584 | // the global definition into std namespace: |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 585 | #if defined(NDNBOOST_NO_STD_TYPEINFO) && defined(__cplusplus) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 586 | #include <typeinfo> |
| 587 | namespace std{ using ::type_info; } |
| 588 | #endif |
| 589 | |
| 590 | // ---------------------------------------------------------------------------// |
| 591 | |
| 592 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 593 | // Helper macro NDNBOOST_STRINGIZE: |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 594 | // Converts the parameter X to a string after macro replacement |
| 595 | // on X has been performed. |
| 596 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 597 | #define NDNBOOST_STRINGIZE(X) NDNBOOST_DO_STRINGIZE(X) |
| 598 | #define NDNBOOST_DO_STRINGIZE(X) #X |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 599 | |
| 600 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 601 | // Helper macro NDNBOOST_JOIN: |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 602 | // The following piece of macro magic joins the two |
| 603 | // arguments together, even when one of the arguments is |
| 604 | // itself a macro (see 16.3.1 in C++ standard). The key |
| 605 | // is that macro expansion of macro arguments does not |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 606 | // occur in NDNBOOST_DO_JOIN2 but does in NDNBOOST_DO_JOIN. |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 607 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 608 | #define NDNBOOST_JOIN( X, Y ) NDNBOOST_DO_JOIN( X, Y ) |
| 609 | #define NDNBOOST_DO_JOIN( X, Y ) NDNBOOST_DO_JOIN2(X,Y) |
| 610 | #define NDNBOOST_DO_JOIN2( X, Y ) X##Y |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 611 | |
| 612 | // |
| 613 | // Set some default values for compiler/library/platform names. |
| 614 | // These are for debugging config setup only: |
| 615 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 616 | # ifndef NDNBOOST_COMPILER |
| 617 | # define NDNBOOST_COMPILER "Unknown ISO C++ Compiler" |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 618 | # endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 619 | # ifndef NDNBOOST_STDLIB |
| 620 | # define NDNBOOST_STDLIB "Unknown ISO standard library" |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 621 | # endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 622 | # ifndef NDNBOOST_PLATFORM |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 623 | # if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \ |
| 624 | || defined(_POSIX_SOURCE) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 625 | # define NDNBOOST_PLATFORM "Generic Unix" |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 626 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 627 | # define NDNBOOST_PLATFORM "Unknown" |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 628 | # endif |
| 629 | # endif |
| 630 | |
| 631 | // |
| 632 | // Set some default values GPU support |
| 633 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 634 | # ifndef NDNBOOST_GPU_ENABLED |
| 635 | # define NDNBOOST_GPU_ENABLED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 636 | # endif |
| 637 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 638 | // NDNBOOST_FORCEINLINE ---------------------------------------------// |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 639 | // Macro to use in place of 'inline' to force a function to be inline |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 640 | #if !defined(NDNBOOST_FORCEINLINE) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 641 | # if defined(_MSC_VER) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 642 | # define NDNBOOST_FORCEINLINE __forceinline |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 643 | # elif defined(__GNUC__) && __GNUC__ > 3 |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 644 | // Clang also defines __GNUC__ (as 4) |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 645 | # define NDNBOOST_FORCEINLINE inline __attribute__ ((__always_inline__)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 646 | # else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 647 | # define NDNBOOST_FORCEINLINE inline |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 648 | # endif |
| 649 | #endif |
| 650 | |
| 651 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 652 | // Set NDNBOOST_NO_DECLTYPE_N3276 when NDNBOOST_NO_DECLTYPE is defined |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 653 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 654 | #if defined(NDNBOOST_NO_CXX11_DECLTYPE) && !defined(NDNBOOST_NO_CXX11_DECLTYPE_N3276) |
| 655 | #define NDNBOOST_NO_CXX11_DECLTYPE_N3276 NDNBOOST_NO_CXX11_DECLTYPE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 656 | #endif |
| 657 | |
| 658 | // -------------------- Deprecated macros for 1.50 --------------------------- |
| 659 | // These will go away in a future release |
| 660 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 661 | // Use NDNBOOST_NO_CXX11_HDR_UNORDERED_SET or NDNBOOST_NO_CXX11_HDR_UNORDERED_MAP |
| 662 | // instead of NDNBOOST_NO_STD_UNORDERED |
| 663 | #if defined(NDNBOOST_NO_CXX11_HDR_UNORDERED_MAP) || defined (NDNBOOST_NO_CXX11_HDR_UNORDERED_SET) |
| 664 | # ifndef NDNBOOST_NO_CXX11_STD_UNORDERED |
| 665 | # define NDNBOOST_NO_CXX11_STD_UNORDERED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 666 | # endif |
| 667 | #endif |
| 668 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 669 | // Use NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST instead of NDNBOOST_NO_INITIALIZER_LISTS |
| 670 | #if defined(NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST) && !defined(NDNBOOST_NO_INITIALIZER_LISTS) |
| 671 | # define NDNBOOST_NO_INITIALIZER_LISTS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 672 | #endif |
| 673 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 674 | // Use NDNBOOST_NO_CXX11_HDR_ARRAY instead of NDNBOOST_NO_0X_HDR_ARRAY |
| 675 | #if defined(NDNBOOST_NO_CXX11_HDR_ARRAY) && !defined(NDNBOOST_NO_0X_HDR_ARRAY) |
| 676 | # define NDNBOOST_NO_0X_HDR_ARRAY |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 677 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 678 | // Use NDNBOOST_NO_CXX11_HDR_CHRONO instead of NDNBOOST_NO_0X_HDR_CHRONO |
| 679 | #if defined(NDNBOOST_NO_CXX11_HDR_CHRONO) && !defined(NDNBOOST_NO_0X_HDR_CHRONO) |
| 680 | # define NDNBOOST_NO_0X_HDR_CHRONO |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 681 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 682 | // Use NDNBOOST_NO_CXX11_HDR_CODECVT instead of NDNBOOST_NO_0X_HDR_CODECVT |
| 683 | #if defined(NDNBOOST_NO_CXX11_HDR_CODECVT) && !defined(NDNBOOST_NO_0X_HDR_CODECVT) |
| 684 | # define NDNBOOST_NO_0X_HDR_CODECVT |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 685 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 686 | // Use NDNBOOST_NO_CXX11_HDR_CONDITION_VARIABLE instead of NDNBOOST_NO_0X_HDR_CONDITION_VARIABLE |
| 687 | #if defined(NDNBOOST_NO_CXX11_HDR_CONDITION_VARIABLE) && !defined(NDNBOOST_NO_0X_HDR_CONDITION_VARIABLE) |
| 688 | # define NDNBOOST_NO_0X_HDR_CONDITION_VARIABLE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 689 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 690 | // Use NDNBOOST_NO_CXX11_HDR_FORWARD_LIST instead of NDNBOOST_NO_0X_HDR_FORWARD_LIST |
| 691 | #if defined(NDNBOOST_NO_CXX11_HDR_FORWARD_LIST) && !defined(NDNBOOST_NO_0X_HDR_FORWARD_LIST) |
| 692 | # define NDNBOOST_NO_0X_HDR_FORWARD_LIST |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 693 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 694 | // Use NDNBOOST_NO_CXX11_HDR_FUTURE instead of NDNBOOST_NO_0X_HDR_FUTURE |
| 695 | #if defined(NDNBOOST_NO_CXX11_HDR_FUTURE) && !defined(NDNBOOST_NO_0X_HDR_FUTURE) |
| 696 | # define NDNBOOST_NO_0X_HDR_FUTURE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 697 | #endif |
| 698 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 699 | // Use NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST |
| 700 | // instead of NDNBOOST_NO_0X_HDR_INITIALIZER_LIST or NDNBOOST_NO_INITIALIZER_LISTS |
| 701 | #ifdef NDNBOOST_NO_CXX11_HDR_INITIALIZER_LIST |
| 702 | # ifndef NDNBOOST_NO_0X_HDR_INITIALIZER_LIST |
| 703 | # define NDNBOOST_NO_0X_HDR_INITIALIZER_LIST |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 704 | # endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 705 | # ifndef NDNBOOST_NO_INITIALIZER_LISTS |
| 706 | # define NDNBOOST_NO_INITIALIZER_LISTS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 707 | # endif |
| 708 | #endif |
| 709 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 710 | // Use NDNBOOST_NO_CXX11_HDR_MUTEX instead of NDNBOOST_NO_0X_HDR_MUTEX |
| 711 | #if defined(NDNBOOST_NO_CXX11_HDR_MUTEX) && !defined(NDNBOOST_NO_0X_HDR_MUTEX) |
| 712 | # define NDNBOOST_NO_0X_HDR_MUTEX |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 713 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 714 | // Use NDNBOOST_NO_CXX11_HDR_RANDOM instead of NDNBOOST_NO_0X_HDR_RANDOM |
| 715 | #if defined(NDNBOOST_NO_CXX11_HDR_RANDOM) && !defined(NDNBOOST_NO_0X_HDR_RANDOM) |
| 716 | # define NDNBOOST_NO_0X_HDR_RANDOM |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 717 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 718 | // Use NDNBOOST_NO_CXX11_HDR_RATIO instead of NDNBOOST_NO_0X_HDR_RATIO |
| 719 | #if defined(NDNBOOST_NO_CXX11_HDR_RATIO) && !defined(NDNBOOST_NO_0X_HDR_RATIO) |
| 720 | # define NDNBOOST_NO_0X_HDR_RATIO |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 721 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 722 | // Use NDNBOOST_NO_CXX11_HDR_REGEX instead of NDNBOOST_NO_0X_HDR_REGEX |
| 723 | #if defined(NDNBOOST_NO_CXX11_HDR_REGEX) && !defined(NDNBOOST_NO_0X_HDR_REGEX) |
| 724 | # define NDNBOOST_NO_0X_HDR_REGEX |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 725 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 726 | // Use NDNBOOST_NO_CXX11_HDR_SYSTEM_ERROR instead of NDNBOOST_NO_0X_HDR_SYSTEM_ERROR |
| 727 | #if defined(NDNBOOST_NO_CXX11_HDR_SYSTEM_ERROR) && !defined(NDNBOOST_NO_0X_HDR_SYSTEM_ERROR) |
| 728 | # define NDNBOOST_NO_0X_HDR_SYSTEM_ERROR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 729 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 730 | // Use NDNBOOST_NO_CXX11_HDR_THREAD instead of NDNBOOST_NO_0X_HDR_THREAD |
| 731 | #if defined(NDNBOOST_NO_CXX11_HDR_THREAD) && !defined(NDNBOOST_NO_0X_HDR_THREAD) |
| 732 | # define NDNBOOST_NO_0X_HDR_THREAD |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 733 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 734 | // Use NDNBOOST_NO_CXX11_HDR_TUPLE instead of NDNBOOST_NO_0X_HDR_TUPLE |
| 735 | #if defined(NDNBOOST_NO_CXX11_HDR_TUPLE) && !defined(NDNBOOST_NO_0X_HDR_TUPLE) |
| 736 | # define NDNBOOST_NO_0X_HDR_TUPLE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 737 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 738 | // Use NDNBOOST_NO_CXX11_HDR_TYPE_TRAITS instead of NDNBOOST_NO_0X_HDR_TYPE_TRAITS |
| 739 | #if defined(NDNBOOST_NO_CXX11_HDR_TYPE_TRAITS) && !defined(NDNBOOST_NO_0X_HDR_TYPE_TRAITS) |
| 740 | # define NDNBOOST_NO_0X_HDR_TYPE_TRAITS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 741 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 742 | // Use NDNBOOST_NO_CXX11_HDR_TYPEINDEX instead of NDNBOOST_NO_0X_HDR_TYPEINDEX |
| 743 | #if defined(NDNBOOST_NO_CXX11_HDR_TYPEINDEX) && !defined(NDNBOOST_NO_0X_HDR_TYPEINDEX) |
| 744 | # define NDNBOOST_NO_0X_HDR_TYPEINDEX |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 745 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 746 | // Use NDNBOOST_NO_CXX11_HDR_UNORDERED_MAP instead of NDNBOOST_NO_0X_HDR_UNORDERED_MAP |
| 747 | #if defined(NDNBOOST_NO_CXX11_HDR_UNORDERED_MAP) && !defined(NDNBOOST_NO_0X_HDR_UNORDERED_MAP) |
| 748 | # define NDNBOOST_NO_0X_HDR_UNORDERED_MAP |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 749 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 750 | // Use NDNBOOST_NO_CXX11_HDR_UNORDERED_SET instead of NDNBOOST_NO_0X_HDR_UNORDERED_SET |
| 751 | #if defined(NDNBOOST_NO_CXX11_HDR_UNORDERED_SET) && !defined(NDNBOOST_NO_0X_HDR_UNORDERED_SET) |
| 752 | # define NDNBOOST_NO_0X_HDR_UNORDERED_SET |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 753 | #endif |
| 754 | |
| 755 | // ------------------ End of deprecated macros for 1.50 --------------------------- |
| 756 | |
| 757 | // -------------------- Deprecated macros for 1.51 --------------------------- |
| 758 | // These will go away in a future release |
| 759 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 760 | // Use NDNBOOST_NO_CXX11_AUTO_DECLARATIONS instead of NDNBOOST_NO_AUTO_DECLARATIONS |
| 761 | #if defined(NDNBOOST_NO_CXX11_AUTO_DECLARATIONS) && !defined(NDNBOOST_NO_AUTO_DECLARATIONS) |
| 762 | # define NDNBOOST_NO_AUTO_DECLARATIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 763 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 764 | // Use NDNBOOST_NO_CXX11_AUTO_MULTIDECLARATIONS instead of NDNBOOST_NO_AUTO_MULTIDECLARATIONS |
| 765 | #if defined(NDNBOOST_NO_CXX11_AUTO_MULTIDECLARATIONS) && !defined(NDNBOOST_NO_AUTO_MULTIDECLARATIONS) |
| 766 | # define NDNBOOST_NO_AUTO_MULTIDECLARATIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 767 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 768 | // Use NDNBOOST_NO_CXX11_CHAR16_T instead of NDNBOOST_NO_CHAR16_T |
| 769 | #if defined(NDNBOOST_NO_CXX11_CHAR16_T) && !defined(NDNBOOST_NO_CHAR16_T) |
| 770 | # define NDNBOOST_NO_CHAR16_T |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 771 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 772 | // Use NDNBOOST_NO_CXX11_CHAR32_T instead of NDNBOOST_NO_CHAR32_T |
| 773 | #if defined(NDNBOOST_NO_CXX11_CHAR32_T) && !defined(NDNBOOST_NO_CHAR32_T) |
| 774 | # define NDNBOOST_NO_CHAR32_T |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 775 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 776 | // Use NDNBOOST_NO_CXX11_TEMPLATE_ALIASES instead of NDNBOOST_NO_TEMPLATE_ALIASES |
| 777 | #if defined(NDNBOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(NDNBOOST_NO_TEMPLATE_ALIASES) |
| 778 | # define NDNBOOST_NO_TEMPLATE_ALIASES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 779 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 780 | // Use NDNBOOST_NO_CXX11_CONSTEXPR instead of NDNBOOST_NO_CONSTEXPR |
| 781 | #if defined(NDNBOOST_NO_CXX11_CONSTEXPR) && !defined(NDNBOOST_NO_CONSTEXPR) |
| 782 | # define NDNBOOST_NO_CONSTEXPR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 783 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 784 | // Use NDNBOOST_NO_CXX11_DECLTYPE_N3276 instead of NDNBOOST_NO_DECLTYPE_N3276 |
| 785 | #if defined(NDNBOOST_NO_CXX11_DECLTYPE_N3276) && !defined(NDNBOOST_NO_DECLTYPE_N3276) |
| 786 | # define NDNBOOST_NO_DECLTYPE_N3276 |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 787 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 788 | // Use NDNBOOST_NO_CXX11_DECLTYPE instead of NDNBOOST_NO_DECLTYPE |
| 789 | #if defined(NDNBOOST_NO_CXX11_DECLTYPE) && !defined(NDNBOOST_NO_DECLTYPE) |
| 790 | # define NDNBOOST_NO_DECLTYPE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 791 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 792 | // Use NDNBOOST_NO_CXX11_DEFAULTED_FUNCTIONS instead of NDNBOOST_NO_DEFAULTED_FUNCTIONS |
| 793 | #if defined(NDNBOOST_NO_CXX11_DEFAULTED_FUNCTIONS) && !defined(NDNBOOST_NO_DEFAULTED_FUNCTIONS) |
| 794 | # define NDNBOOST_NO_DEFAULTED_FUNCTIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 795 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 796 | // Use NDNBOOST_NO_CXX11_DELETED_FUNCTIONS instead of NDNBOOST_NO_DELETED_FUNCTIONS |
| 797 | #if defined(NDNBOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(NDNBOOST_NO_DELETED_FUNCTIONS) |
| 798 | # define NDNBOOST_NO_DELETED_FUNCTIONS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 799 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 800 | // Use NDNBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS instead of NDNBOOST_NO_EXPLICIT_CONVERSION_OPERATORS |
| 801 | #if defined(NDNBOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) && !defined(NDNBOOST_NO_EXPLICIT_CONVERSION_OPERATORS) |
| 802 | # define NDNBOOST_NO_EXPLICIT_CONVERSION_OPERATORS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 803 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 804 | // Use NDNBOOST_NO_CXX11_EXTERN_TEMPLATE instead of NDNBOOST_NO_EXTERN_TEMPLATE |
| 805 | #if defined(NDNBOOST_NO_CXX11_EXTERN_TEMPLATE) && !defined(NDNBOOST_NO_EXTERN_TEMPLATE) |
| 806 | # define NDNBOOST_NO_EXTERN_TEMPLATE |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 807 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 808 | // Use NDNBOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS instead of NDNBOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS |
| 809 | #if defined(NDNBOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS) && !defined(NDNBOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS) |
| 810 | # define NDNBOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 811 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 812 | // Use NDNBOOST_NO_CXX11_LAMBDAS instead of NDNBOOST_NO_LAMBDAS |
| 813 | #if defined(NDNBOOST_NO_CXX11_LAMBDAS) && !defined(NDNBOOST_NO_LAMBDAS) |
| 814 | # define NDNBOOST_NO_LAMBDAS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 815 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 816 | // Use NDNBOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS instead of NDNBOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS |
| 817 | #if defined(NDNBOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS) && !defined(NDNBOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS) |
| 818 | # define NDNBOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 819 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 820 | // Use NDNBOOST_NO_CXX11_NOEXCEPT instead of NDNBOOST_NO_NOEXCEPT |
| 821 | #if defined(NDNBOOST_NO_CXX11_NOEXCEPT) && !defined(NDNBOOST_NO_NOEXCEPT) |
| 822 | # define NDNBOOST_NO_NOEXCEPT |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 823 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 824 | // Use NDNBOOST_NO_CXX11_NULLPTR instead of NDNBOOST_NO_NULLPTR |
| 825 | #if defined(NDNBOOST_NO_CXX11_NULLPTR) && !defined(NDNBOOST_NO_NULLPTR) |
| 826 | # define NDNBOOST_NO_NULLPTR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 827 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 828 | // Use NDNBOOST_NO_CXX11_RAW_LITERALS instead of NDNBOOST_NO_RAW_LITERALS |
| 829 | #if defined(NDNBOOST_NO_CXX11_RAW_LITERALS) && !defined(NDNBOOST_NO_RAW_LITERALS) |
| 830 | # define NDNBOOST_NO_RAW_LITERALS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 831 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 832 | // Use NDNBOOST_NO_CXX11_RVALUE_REFERENCES instead of NDNBOOST_NO_RVALUE_REFERENCES |
| 833 | #if defined(NDNBOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(NDNBOOST_NO_RVALUE_REFERENCES) |
| 834 | # define NDNBOOST_NO_RVALUE_REFERENCES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 835 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 836 | // Use NDNBOOST_NO_CXX11_SCOPED_ENUMS instead of NDNBOOST_NO_SCOPED_ENUMS |
| 837 | #if defined(NDNBOOST_NO_CXX11_SCOPED_ENUMS) && !defined(NDNBOOST_NO_SCOPED_ENUMS) |
| 838 | # define NDNBOOST_NO_SCOPED_ENUMS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 839 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 840 | // Use NDNBOOST_NO_CXX11_STATIC_ASSERT instead of NDNBOOST_NO_STATIC_ASSERT |
| 841 | #if defined(NDNBOOST_NO_CXX11_STATIC_ASSERT) && !defined(NDNBOOST_NO_STATIC_ASSERT) |
| 842 | # define NDNBOOST_NO_STATIC_ASSERT |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 843 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 844 | // Use NDNBOOST_NO_CXX11_STD_UNORDERED instead of NDNBOOST_NO_STD_UNORDERED |
| 845 | #if defined(NDNBOOST_NO_CXX11_STD_UNORDERED) && !defined(NDNBOOST_NO_STD_UNORDERED) |
| 846 | # define NDNBOOST_NO_STD_UNORDERED |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 847 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 848 | // Use NDNBOOST_NO_CXX11_UNICODE_LITERALS instead of NDNBOOST_NO_UNICODE_LITERALS |
| 849 | #if defined(NDNBOOST_NO_CXX11_UNICODE_LITERALS) && !defined(NDNBOOST_NO_UNICODE_LITERALS) |
| 850 | # define NDNBOOST_NO_UNICODE_LITERALS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 851 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 852 | // Use NDNBOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX instead of NDNBOOST_NO_UNIFIED_INITIALIZATION_SYNTAX |
| 853 | #if defined(NDNBOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX) && !defined(NDNBOOST_NO_UNIFIED_INITIALIZATION_SYNTAX) |
| 854 | # define NDNBOOST_NO_UNIFIED_INITIALIZATION_SYNTAX |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 855 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 856 | // Use NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES instead of NDNBOOST_NO_VARIADIC_TEMPLATES |
| 857 | #if defined(NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(NDNBOOST_NO_VARIADIC_TEMPLATES) |
| 858 | # define NDNBOOST_NO_VARIADIC_TEMPLATES |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 859 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 860 | // Use NDNBOOST_NO_CXX11_VARIADIC_MACROS instead of NDNBOOST_NO_VARIADIC_MACROS |
| 861 | #if defined(NDNBOOST_NO_CXX11_VARIADIC_MACROS) && !defined(NDNBOOST_NO_VARIADIC_MACROS) |
| 862 | # define NDNBOOST_NO_VARIADIC_MACROS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 863 | #endif |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 864 | // Use NDNBOOST_NO_CXX11_NUMERIC_LIMITS instead of NDNBOOST_NO_NUMERIC_LIMITS_LOWEST |
| 865 | #if defined(NDNBOOST_NO_CXX11_NUMERIC_LIMITS) && !defined(NDNBOOST_NO_NUMERIC_LIMITS_LOWEST) |
| 866 | # define NDNBOOST_NO_NUMERIC_LIMITS_LOWEST |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 867 | #endif |
| 868 | // ------------------ End of deprecated macros for 1.51 --------------------------- |
| 869 | |
| 870 | |
| 871 | |
| 872 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 873 | // Helper macros NDNBOOST_NOEXCEPT, NDNBOOST_NOEXCEPT_IF, NDNBOOST_NOEXCEPT_EXPR |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 874 | // These aid the transition to C++11 while still supporting C++03 compilers |
| 875 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 876 | #ifdef NDNBOOST_NO_CXX11_NOEXCEPT |
| 877 | # define NDNBOOST_NOEXCEPT |
| 878 | # define NDNBOOST_NOEXCEPT_OR_NOTHROW throw() |
| 879 | # define NDNBOOST_NOEXCEPT_IF(Predicate) |
| 880 | # define NDNBOOST_NOEXCEPT_EXPR(Expression) false |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 881 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 882 | # define NDNBOOST_NOEXCEPT noexcept |
| 883 | # define NDNBOOST_NOEXCEPT_OR_NOTHROW noexcept |
| 884 | # define NDNBOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate)) |
| 885 | # define NDNBOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression)) |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 886 | #endif |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 887 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 888 | // Helper macro NDNBOOST_FALLTHROUGH |
| 889 | // Fallback definition of NDNBOOST_FALLTHROUGH macro used to mark intended |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 890 | // fall-through between case labels in a switch statement. We use a definition |
| 891 | // that requires a semicolon after it to avoid at least one type of misuse even |
| 892 | // on unsupported compilers. |
| 893 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 894 | #ifndef NDNBOOST_FALLTHROUGH |
| 895 | # define NDNBOOST_FALLTHROUGH ((void)0) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 896 | #endif |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 897 | |
| 898 | // |
| 899 | // constexpr workarounds |
| 900 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 901 | #if defined(NDNBOOST_NO_CXX11_CONSTEXPR) |
| 902 | #define NDNBOOST_CONSTEXPR |
| 903 | #define NDNBOOST_CONSTEXPR_OR_CONST const |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 904 | #else |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 905 | #define NDNBOOST_CONSTEXPR constexpr |
| 906 | #define NDNBOOST_CONSTEXPR_OR_CONST constexpr |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 907 | #endif |
| 908 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 909 | #define NDNBOOST_STATIC_CONSTEXPR static NDNBOOST_CONSTEXPR_OR_CONST |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 910 | |
| 911 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 912 | // Set NDNBOOST_HAS_STATIC_ASSERT when NDNBOOST_NO_CXX11_STATIC_ASSERT is not defined |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 913 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 914 | #if !defined(NDNBOOST_NO_CXX11_STATIC_ASSERT) && !defined(NDNBOOST_HAS_STATIC_ASSERT) |
| 915 | # define NDNBOOST_HAS_STATIC_ASSERT |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 916 | #endif |
| 917 | |
| 918 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 919 | // Set NDNBOOST_HAS_RVALUE_REFS when NDNBOOST_NO_CXX11_RVALUE_REFERENCES is not defined |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 920 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 921 | #if !defined(NDNBOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(NDNBOOST_HAS_RVALUE_REFS) |
| 922 | #define NDNBOOST_HAS_RVALUE_REFS |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 923 | #endif |
| 924 | |
| 925 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 926 | // Set NDNBOOST_HAS_VARIADIC_TMPL when NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES is not defined |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 927 | // |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame^] | 928 | #if !defined(NDNBOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(NDNBOOST_HAS_VARIADIC_TMPL) |
| 929 | #define NDNBOOST_HAS_VARIADIC_TMPL |
Jeff Thompson | f7d4994 | 2013-08-01 16:47:40 -0700 | [diff] [blame] | 930 | #endif |
| 931 | |
| 932 | |
| 933 | #endif |