epoc32/include/stdapis/boost/config/suffix.hpp
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
//  Boost config.hpp configuration header file  ------------------------------//
williamr@2
     2
williamr@2
     3
//  (C) Copyright John Maddock 2001 - 2003.
williamr@2
     4
//  (C) Copyright Darin Adler 2001.
williamr@2
     5
//  (C) Copyright Peter Dimov 2001.
williamr@2
     6
//  (C) Copyright Bill Kempf 2002.
williamr@2
     7
//  (C) Copyright Jens Maurer 2002.
williamr@2
     8
//  (C) Copyright David Abrahams 2002 - 2003.
williamr@2
     9
//  (C) Copyright Gennaro Prota 2003.
williamr@2
    10
//  (C) Copyright Eric Friedman 2003.
williamr@2
    11
//  Use, modification and distribution are subject to the
williamr@2
    12
//  Boost Software License, Version 1.0. (See accompanying file
williamr@2
    13
//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
williamr@2
    14
williamr@2
    15
//  See http://www.boost.org for most recent version.
williamr@2
    16
williamr@2
    17
//  Boost config.hpp policy and rationale documentation has been moved to
williamr@2
    18
//  http://www.boost.org/libs/config
williamr@2
    19
//
williamr@2
    20
//  This file is intended to be stable, and relatively unchanging.
williamr@2
    21
//  It should contain boilerplate code only - no compiler specific
williamr@2
    22
//  code unless it is unavoidable - no changes unless unavoidable.
williamr@2
    23
williamr@2
    24
#ifndef BOOST_CONFIG_SUFFIX_HPP
williamr@2
    25
#define BOOST_CONFIG_SUFFIX_HPP
williamr@2
    26
williamr@2
    27
//
williamr@2
    28
// look for long long by looking for the appropriate macros in <limits.h>.
williamr@2
    29
// Note that we use limits.h rather than climits for maximal portability,
williamr@2
    30
// remember that since these just declare a bunch of macros, there should be
williamr@2
    31
// no namespace issues from this.
williamr@2
    32
//
williamr@2
    33
#if !defined(BOOST_HAS_LONG_LONG)                                               \
williamr@2
    34
   && !defined(BOOST_MSVC) && !defined(__BORLANDC__)
williamr@2
    35
# include <limits.h>
williamr@2
    36
# if (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX))
williamr@2
    37
#   define BOOST_HAS_LONG_LONG
williamr@2
    38
# endif
williamr@2
    39
#endif
williamr@2
    40
williamr@2
    41
// GCC 3.x will clean up all of those nasty macro definitions that
williamr@2
    42
// BOOST_NO_CTYPE_FUNCTIONS is intended to help work around, so undefine
williamr@2
    43
// it under GCC 3.x.
williamr@2
    44
#if defined(__GNUC__) && (__GNUC__ >= 3) && defined(BOOST_NO_CTYPE_FUNCTIONS)
williamr@2
    45
#  undef BOOST_NO_CTYPE_FUNCTIONS
williamr@2
    46
#endif
williamr@2
    47
williamr@2
    48
williamr@2
    49
//
williamr@2
    50
// Assume any extensions are in namespace std:: unless stated otherwise:
williamr@2
    51
//
williamr@2
    52
#  ifndef BOOST_STD_EXTENSION_NAMESPACE
williamr@2
    53
#    define BOOST_STD_EXTENSION_NAMESPACE std
williamr@2
    54
#  endif
williamr@2
    55
williamr@2
    56
//
williamr@2
    57
// If cv-qualified specializations are not allowed, then neither are cv-void ones:
williamr@2
    58
//
williamr@2
    59
#  if defined(BOOST_NO_CV_SPECIALIZATIONS) \
williamr@2
    60
      && !defined(BOOST_NO_CV_VOID_SPECIALIZATIONS)
williamr@2
    61
#     define BOOST_NO_CV_VOID_SPECIALIZATIONS
williamr@2
    62
#  endif
williamr@2
    63
williamr@2
    64
//
williamr@2
    65
// If there is no numeric_limits template, then it can't have any compile time
williamr@2
    66
// constants either!
williamr@2
    67
//
williamr@2
    68
#  if defined(BOOST_NO_LIMITS) \
williamr@2
    69
      && !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
williamr@2
    70
#     define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
williamr@2
    71
#     define BOOST_NO_MS_INT64_NUMERIC_LIMITS
williamr@2
    72
#     define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
williamr@2
    73
#  endif
williamr@2
    74
williamr@2
    75
//
williamr@2
    76
// if there is no long long then there is no specialisation
williamr@2
    77
// for numeric_limits<long long> either:
williamr@2
    78
//
williamr@2
    79
#if !defined(BOOST_HAS_LONG_LONG) && !defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)
williamr@2
    80
#  define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
williamr@2
    81
#endif
williamr@2
    82
williamr@2
    83
//
williamr@2
    84
// if there is no __int64 then there is no specialisation
williamr@2
    85
// for numeric_limits<__int64> either:
williamr@2
    86
//
williamr@2
    87
#if !defined(BOOST_HAS_MS_INT64) && !defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS)
williamr@2
    88
#  define BOOST_NO_MS_INT64_NUMERIC_LIMITS
williamr@2
    89
#endif
williamr@2
    90
williamr@2
    91
//
williamr@2
    92
// if member templates are supported then so is the
williamr@2
    93
// VC6 subset of member templates:
williamr@2
    94
//
williamr@2
    95
#  if !defined(BOOST_NO_MEMBER_TEMPLATES) \
williamr@2
    96
       && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
williamr@2
    97
#     define BOOST_MSVC6_MEMBER_TEMPLATES
williamr@2
    98
#  endif
williamr@2
    99
williamr@2
   100
//
williamr@2
   101
// Without partial specialization, can't test for partial specialisation bugs:
williamr@2
   102
//
williamr@2
   103
#  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
williamr@2
   104
      && !defined(BOOST_BCB_PARTIAL_SPECIALIZATION_BUG)
williamr@2
   105
#     define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG
williamr@2
   106
#  endif
williamr@2
   107
williamr@2
   108
//
williamr@2
   109
// Without partial specialization, we can't have array-type partial specialisations:
williamr@2
   110
//
williamr@2
   111
#  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
williamr@2
   112
      && !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
williamr@2
   113
#     define BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS
williamr@2
   114
#  endif
williamr@2
   115
williamr@2
   116
//
williamr@2
   117
// Without partial specialization, std::iterator_traits can't work:
williamr@2
   118
//
williamr@2
   119
#  if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
williamr@2
   120
      && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
williamr@2
   121
#     define BOOST_NO_STD_ITERATOR_TRAITS
williamr@2
   122
#  endif
williamr@2
   123
williamr@2
   124
//
williamr@2
   125
// Without member template support, we can't have template constructors
williamr@2
   126
// in the standard library either:
williamr@2
   127
//
williamr@2
   128
#  if defined(BOOST_NO_MEMBER_TEMPLATES) \
williamr@2
   129
      && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
williamr@2
   130
      && !defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
williamr@2
   131
#     define BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
williamr@2
   132
#  endif
williamr@2
   133
williamr@2
   134
//
williamr@2
   135
// Without member template support, we can't have a conforming
williamr@2
   136
// std::allocator template either:
williamr@2
   137
//
williamr@2
   138
#  if defined(BOOST_NO_MEMBER_TEMPLATES) \
williamr@2
   139
      && !defined(BOOST_MSVC6_MEMBER_TEMPLATES) \
williamr@2
   140
      && !defined(BOOST_NO_STD_ALLOCATOR)
williamr@2
   141
#     define BOOST_NO_STD_ALLOCATOR
williamr@2
   142
#  endif
williamr@2
   143
williamr@2
   144
//
williamr@2
   145
// without ADL support then using declarations will break ADL as well:
williamr@2
   146
//
williamr@2
   147
#if defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) && !defined(BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL)
williamr@2
   148
#  define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
williamr@2
   149
#endif
williamr@2
   150
williamr@2
   151
//
williamr@2
   152
// If we have a standard allocator, then we have a partial one as well:
williamr@2
   153
//
williamr@2
   154
#if !defined(BOOST_NO_STD_ALLOCATOR)
williamr@2
   155
#  define BOOST_HAS_PARTIAL_STD_ALLOCATOR
williamr@2
   156
#endif
williamr@2
   157
williamr@2
   158
//
williamr@2
   159
// We can't have a working std::use_facet if there is no std::locale:
williamr@2
   160
//
williamr@2
   161
#  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_USE_FACET)
williamr@2
   162
#     define BOOST_NO_STD_USE_FACET
williamr@2
   163
#  endif
williamr@2
   164
williamr@2
   165
//
williamr@2
   166
// We can't have a std::messages facet if there is no std::locale:
williamr@2
   167
//
williamr@2
   168
#  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_MESSAGES)
williamr@2
   169
#     define BOOST_NO_STD_MESSAGES
williamr@2
   170
#  endif
williamr@2
   171
williamr@2
   172
//
williamr@2
   173
// We can't have a working std::wstreambuf if there is no std::locale:
williamr@2
   174
//
williamr@2
   175
#  if defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_NO_STD_WSTREAMBUF)
williamr@2
   176
#     define BOOST_NO_STD_WSTREAMBUF
williamr@2
   177
#  endif
williamr@2
   178
williamr@2
   179
//
williamr@2
   180
// We can't have a <cwctype> if there is no <cwchar>:
williamr@2
   181
//
williamr@2
   182
#  if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_CWCTYPE)
williamr@2
   183
#     define BOOST_NO_CWCTYPE
williamr@2
   184
#  endif
williamr@2
   185
williamr@2
   186
//
williamr@2
   187
// We can't have a swprintf if there is no <cwchar>:
williamr@2
   188
//
williamr@2
   189
#  if defined(BOOST_NO_CWCHAR) && !defined(BOOST_NO_SWPRINTF)
williamr@2
   190
#     define BOOST_NO_SWPRINTF
williamr@2
   191
#  endif
williamr@2
   192
williamr@2
   193
//
williamr@2
   194
// If Win32 support is turned off, then we must turn off
williamr@2
   195
// threading support also, unless there is some other
williamr@2
   196
// thread API enabled:
williamr@2
   197
//
williamr@2
   198
#if defined(BOOST_DISABLE_WIN32) && defined(_WIN32) \
williamr@2
   199
   && !defined(BOOST_DISABLE_THREADS) && !defined(BOOST_HAS_PTHREADS)
williamr@2
   200
#  define BOOST_DISABLE_THREADS
williamr@2
   201
#endif
williamr@2
   202
williamr@2
   203
//
williamr@2
   204
// Turn on threading support if the compiler thinks that it's in
williamr@2
   205
// multithreaded mode.  We put this here because there are only a
williamr@2
   206
// limited number of macros that identify this (if there's any missing
williamr@2
   207
// from here then add to the appropriate compiler section):
williamr@2
   208
//
williamr@2
   209
#if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
williamr@2
   210
    || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)
williamr@2
   211
#  define BOOST_HAS_THREADS
williamr@2
   212
#endif
williamr@2
   213
williamr@2
   214
//
williamr@2
   215
// Turn threading support off if BOOST_DISABLE_THREADS is defined:
williamr@2
   216
//
williamr@2
   217
#if defined(BOOST_DISABLE_THREADS) && defined(BOOST_HAS_THREADS)
williamr@2
   218
#  undef BOOST_HAS_THREADS
williamr@2
   219
#endif
williamr@2
   220
williamr@2
   221
//
williamr@2
   222
// Turn threading support off if we don't recognise the threading API:
williamr@2
   223
//
williamr@2
   224
#if defined(BOOST_HAS_THREADS) && !defined(BOOST_HAS_PTHREADS)\
williamr@2
   225
      && !defined(BOOST_HAS_WINTHREADS) && !defined(BOOST_HAS_BETHREADS)\
williamr@2
   226
      && !defined(BOOST_HAS_MPTASKS)
williamr@2
   227
#  undef BOOST_HAS_THREADS
williamr@2
   228
#endif
williamr@2
   229
williamr@2
   230
//
williamr@2
   231
// Turn threading detail macros off if we don't (want to) use threading
williamr@2
   232
//
williamr@2
   233
#ifndef BOOST_HAS_THREADS
williamr@2
   234
#  undef BOOST_HAS_PTHREADS
williamr@2
   235
#  undef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE
williamr@2
   236
#  undef BOOST_HAS_WINTHREADS
williamr@2
   237
#  undef BOOST_HAS_BETHREADS
williamr@2
   238
#  undef BOOST_HAS_MPTASKS
williamr@2
   239
#endif
williamr@2
   240
williamr@2
   241
//
williamr@2
   242
// If the compiler claims to be C99 conformant, then it had better
williamr@2
   243
// have a <stdint.h>:
williamr@2
   244
//
williamr@2
   245
#  if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)
williamr@2
   246
#     define BOOST_HAS_STDINT_H
williamr@2
   247
#     ifndef BOOST_HAS_LOG1P
williamr@2
   248
#        define BOOST_HAS_LOG1P
williamr@2
   249
#     endif
williamr@2
   250
#     ifndef BOOST_HAS_EXPM1
williamr@2
   251
#        define BOOST_HAS_EXPM1
williamr@2
   252
#     endif
williamr@2
   253
#  endif
williamr@2
   254
williamr@2
   255
//
williamr@2
   256
// Define BOOST_NO_SLIST and BOOST_NO_HASH if required.
williamr@2
   257
// Note that this is for backwards compatibility only.
williamr@2
   258
//
williamr@2
   259
#  ifndef BOOST_HAS_SLIST
williamr@2
   260
#     define BOOST_NO_SLIST
williamr@2
   261
#  endif
williamr@2
   262
williamr@2
   263
#  ifndef BOOST_HAS_HASH
williamr@2
   264
#     define BOOST_NO_HASH
williamr@2
   265
#  endif
williamr@2
   266
williamr@2
   267
//
williamr@2
   268
// Set BOOST_SLIST_HEADER if not set already:
williamr@2
   269
//
williamr@2
   270
#if defined(BOOST_HAS_SLIST) && !defined(BOOST_SLIST_HEADER)
williamr@2
   271
#  define BOOST_SLIST_HEADER <slist>
williamr@2
   272
#endif
williamr@2
   273
williamr@2
   274
//
williamr@2
   275
// Set BOOST_HASH_SET_HEADER if not set already:
williamr@2
   276
//
williamr@2
   277
#if defined(BOOST_HAS_HASH) && !defined(BOOST_HASH_SET_HEADER)
williamr@2
   278
#  define BOOST_HASH_SET_HEADER <hash_set>
williamr@2
   279
#endif
williamr@2
   280
williamr@2
   281
//
williamr@2
   282
// Set BOOST_HASH_MAP_HEADER if not set already:
williamr@2
   283
//
williamr@2
   284
#if defined(BOOST_HAS_HASH) && !defined(BOOST_HASH_MAP_HEADER)
williamr@2
   285
#  define BOOST_HASH_MAP_HEADER <hash_map>
williamr@2
   286
#endif
williamr@2
   287
williamr@2
   288
//  BOOST_HAS_ABI_HEADERS
williamr@2
   289
//  This macro gets set if we have headers that fix the ABI,
williamr@2
   290
//  and prevent ODR violations when linking to external libraries:
williamr@2
   291
#if defined(BOOST_ABI_PREFIX) && defined(BOOST_ABI_SUFFIX) && !defined(BOOST_HAS_ABI_HEADERS)
williamr@2
   292
#  define BOOST_HAS_ABI_HEADERS
williamr@2
   293
#endif
williamr@2
   294
williamr@2
   295
#if defined(BOOST_HAS_ABI_HEADERS) && defined(BOOST_DISABLE_ABI_HEADERS)
williamr@2
   296
#  undef BOOST_HAS_ABI_HEADERS
williamr@2
   297
#endif
williamr@2
   298
williamr@2
   299
//  BOOST_NO_STDC_NAMESPACE workaround  --------------------------------------//
williamr@2
   300
//  Because std::size_t usage is so common, even in boost headers which do not
williamr@2
   301
//  otherwise use the C library, the <cstddef> workaround is included here so
williamr@2
   302
//  that ugly workaround code need not appear in many other boost headers.
williamr@2
   303
//  NOTE WELL: This is a workaround for non-conforming compilers; <cstddef>
williamr@2
   304
//  must still be #included in the usual places so that <cstddef> inclusion
williamr@2
   305
//  works as expected with standard conforming compilers.  The resulting
williamr@2
   306
//  double inclusion of <cstddef> is harmless.
williamr@2
   307
williamr@2
   308
# ifdef BOOST_NO_STDC_NAMESPACE
williamr@2
   309
#   include <cstddef>
williamr@2
   310
    namespace std { using ::ptrdiff_t; using ::size_t; }
williamr@2
   311
# endif
williamr@2
   312
williamr@2
   313
//  Workaround for the unfortunate min/max macros defined by some platform headers
williamr@2
   314
williamr@2
   315
#define BOOST_PREVENT_MACRO_SUBSTITUTION
williamr@2
   316
williamr@2
   317
#ifndef BOOST_USING_STD_MIN
williamr@2
   318
#  define BOOST_USING_STD_MIN() using std::min
williamr@2
   319
#endif
williamr@2
   320
williamr@2
   321
#ifndef BOOST_USING_STD_MAX
williamr@2
   322
#  define BOOST_USING_STD_MAX() using std::max
williamr@2
   323
#endif
williamr@2
   324
williamr@2
   325
//  BOOST_NO_STD_MIN_MAX workaround  -----------------------------------------//
williamr@2
   326
williamr@2
   327
#  ifdef BOOST_NO_STD_MIN_MAX
williamr@2
   328
williamr@2
   329
namespace std {
williamr@2
   330
  template <class _Tp>
williamr@2
   331
  inline const _Tp& min BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) {
williamr@2
   332
    return __b < __a ? __b : __a;
williamr@2
   333
  }
williamr@2
   334
  template <class _Tp>
williamr@2
   335
  inline const _Tp& max BOOST_PREVENT_MACRO_SUBSTITUTION (const _Tp& __a, const _Tp& __b) {
williamr@2
   336
    return  __a < __b ? __b : __a;
williamr@2
   337
  }
williamr@2
   338
}
williamr@2
   339
williamr@2
   340
#  endif
williamr@2
   341
williamr@2
   342
// BOOST_STATIC_CONSTANT workaround --------------------------------------- //
williamr@2
   343
// On compilers which don't allow in-class initialization of static integral
williamr@2
   344
// constant members, we must use enums as a workaround if we want the constants
williamr@2
   345
// to be available at compile-time. This macro gives us a convenient way to
williamr@2
   346
// declare such constants.
williamr@2
   347
williamr@2
   348
#  ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
williamr@2
   349
#       define BOOST_STATIC_CONSTANT(type, assignment) enum { assignment }
williamr@2
   350
#  else
williamr@2
   351
#     define BOOST_STATIC_CONSTANT(type, assignment) static const type assignment
williamr@2
   352
#  endif
williamr@2
   353
williamr@2
   354
// BOOST_USE_FACET / HAS_FACET workaround ----------------------------------//
williamr@2
   355
// When the standard library does not have a conforming std::use_facet there
williamr@2
   356
// are various workarounds available, but they differ from library to library.
williamr@2
   357
// The same problem occurs with has_facet.
williamr@2
   358
// These macros provide a consistent way to access a locale's facets.
williamr@2
   359
// Usage:
williamr@2
   360
//    replace
williamr@2
   361
//       std::use_facet<Type>(loc);
williamr@2
   362
//    with
williamr@2
   363
//       BOOST_USE_FACET(Type, loc);
williamr@2
   364
//    Note do not add a std:: prefix to the front of BOOST_USE_FACET!
williamr@2
   365
//  Use for BOOST_HAS_FACET is analagous.
williamr@2
   366
williamr@2
   367
#if defined(BOOST_NO_STD_USE_FACET)
williamr@2
   368
#  ifdef BOOST_HAS_TWO_ARG_USE_FACET
williamr@2
   369
#     define BOOST_USE_FACET(Type, loc) std::use_facet(loc, static_cast<Type*>(0))
williamr@2
   370
#     define BOOST_HAS_FACET(Type, loc) std::has_facet(loc, static_cast<Type*>(0))
williamr@2
   371
#  elif defined(BOOST_HAS_MACRO_USE_FACET)
williamr@2
   372
#     define BOOST_USE_FACET(Type, loc) std::_USE(loc, Type)
williamr@2
   373
#     define BOOST_HAS_FACET(Type, loc) std::_HAS(loc, Type)
williamr@2
   374
#  elif defined(BOOST_HAS_STLP_USE_FACET)
williamr@2
   375
#     define BOOST_USE_FACET(Type, loc) (*std::_Use_facet<Type >(loc))
williamr@2
   376
#     define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc)
williamr@2
   377
#  endif
williamr@2
   378
#else
williamr@2
   379
#  define BOOST_USE_FACET(Type, loc) std::use_facet< Type >(loc)
williamr@2
   380
#  define BOOST_HAS_FACET(Type, loc) std::has_facet< Type >(loc)
williamr@2
   381
#endif
williamr@2
   382
williamr@2
   383
// BOOST_NESTED_TEMPLATE workaround ------------------------------------------//
williamr@2
   384
// Member templates are supported by some compilers even though they can't use
williamr@2
   385
// the A::template member<U> syntax, as a workaround replace:
williamr@2
   386
//
williamr@2
   387
// typedef typename A::template rebind<U> binder;
williamr@2
   388
//
williamr@2
   389
// with:
williamr@2
   390
//
williamr@2
   391
// typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;
williamr@2
   392
williamr@2
   393
#ifndef BOOST_NO_MEMBER_TEMPLATE_KEYWORD
williamr@2
   394
#  define BOOST_NESTED_TEMPLATE template
williamr@2
   395
#else
williamr@2
   396
#  define BOOST_NESTED_TEMPLATE
williamr@2
   397
#endif
williamr@2
   398
williamr@2
   399
// BOOST_UNREACHABLE_RETURN(x) workaround -------------------------------------//
williamr@2
   400
// Normally evaluates to nothing, unless BOOST_NO_UNREACHABLE_RETURN_DETECTION
williamr@2
   401
// is defined, in which case it evaluates to return x; Use when you have a return
williamr@2
   402
// statement that can never be reached.
williamr@2
   403
williamr@2
   404
#ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
williamr@2
   405
#  define BOOST_UNREACHABLE_RETURN(x) return x;
williamr@2
   406
#else
williamr@2
   407
#  define BOOST_UNREACHABLE_RETURN(x)
williamr@2
   408
#endif
williamr@2
   409
williamr@2
   410
// BOOST_DEDUCED_TYPENAME workaround ------------------------------------------//
williamr@2
   411
//
williamr@2
   412
// Some compilers don't support the use of `typename' for dependent
williamr@2
   413
// types in deduced contexts, e.g.
williamr@2
   414
//
williamr@2
   415
//     template <class T> void f(T, typename T::type);
williamr@2
   416
//                                  ^^^^^^^^
williamr@2
   417
// Replace these declarations with:
williamr@2
   418
//
williamr@2
   419
//     template <class T> void f(T, BOOST_DEDUCED_TYPENAME T::type);
williamr@2
   420
williamr@2
   421
#ifndef BOOST_NO_DEDUCED_TYPENAME
williamr@2
   422
#  define BOOST_DEDUCED_TYPENAME typename
williamr@2
   423
#else
williamr@2
   424
#  define BOOST_DEDUCED_TYPENAME
williamr@2
   425
#endif
williamr@2
   426
williamr@2
   427
// long long workaround ------------------------------------------//
williamr@2
   428
// On gcc (and maybe other compilers?) long long is alway supported
williamr@2
   429
// but it's use may generate either warnings (with -ansi), or errors
williamr@2
   430
// (with -pedantic -ansi) unless it's use is prefixed by __extension__
williamr@2
   431
//
williamr@2
   432
#if defined(BOOST_HAS_LONG_LONG)
williamr@2
   433
namespace boost{
williamr@2
   434
#  ifdef __GNUC__
williamr@2
   435
   __extension__ typedef long long long_long_type;
williamr@2
   436
   __extension__ typedef unsigned long long ulong_long_type;
williamr@2
   437
#  else
williamr@2
   438
   typedef long long long_long_type;
williamr@2
   439
   typedef unsigned long long ulong_long_type;
williamr@2
   440
#  endif
williamr@2
   441
}
williamr@2
   442
#endif
williamr@2
   443
williamr@2
   444
// BOOST_[APPEND_]EXPLICIT_TEMPLATE_[NON_]TYPE macros --------------------------//
williamr@2
   445
//
williamr@2
   446
// Some compilers have problems with function templates whose
williamr@2
   447
// template parameters don't appear in the function parameter
williamr@2
   448
// list (basically they just link one instantiation of the
williamr@2
   449
// template in the final executable). These macros provide a
williamr@2
   450
// uniform way to cope with the problem with no effects on the
williamr@2
   451
// calling syntax.
williamr@2
   452
williamr@2
   453
// Example:
williamr@2
   454
//
williamr@2
   455
//  #include <iostream>
williamr@2
   456
//  #include <ostream>
williamr@2
   457
//  #include <typeinfo>
williamr@2
   458
//
williamr@2
   459
//  template <int n>
williamr@2
   460
//  void f() { std::cout << n << ' '; }
williamr@2
   461
//
williamr@2
   462
//  template <typename T>
williamr@2
   463
//  void g() { std::cout << typeid(T).name() << ' '; }
williamr@2
   464
//
williamr@2
   465
//  int main() {
williamr@2
   466
//    f<1>();
williamr@2
   467
//    f<2>();
williamr@2
   468
//
williamr@2
   469
//    g<int>();
williamr@2
   470
//    g<double>();
williamr@2
   471
//  }
williamr@2
   472
//
williamr@2
   473
// With VC++ 6.0 the output is:
williamr@2
   474
//
williamr@2
   475
//   2 2 double double
williamr@2
   476
//
williamr@2
   477
// To fix it, write
williamr@2
   478
//
williamr@2
   479
//   template <int n>
williamr@2
   480
//   void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
williamr@2
   481
//
williamr@2
   482
//   template <typename T>
williamr@2
   483
//   void g(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... }
williamr@2
   484
//
williamr@2
   485
williamr@2
   486
williamr@2
   487
#if defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
williamr@2
   488
williamr@2
   489
#  include "boost/type.hpp"
williamr@2
   490
#  include "boost/non_type.hpp"
williamr@2
   491
williamr@2
   492
#  define BOOST_EXPLICIT_TEMPLATE_TYPE(t)         boost::type<t>* = 0
williamr@2
   493
#  define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)    boost::type<t>*
williamr@2
   494
#  define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)  boost::non_type<t, v>* = 0
williamr@2
   495
#  define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)  boost::non_type<t, v>*
williamr@2
   496
williamr@2
   497
#  define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)         \
williamr@2
   498
             , BOOST_EXPLICIT_TEMPLATE_TYPE(t)
williamr@2
   499
#  define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)    \
williamr@2
   500
             , BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
williamr@2
   501
#  define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)  \
williamr@2
   502
             , BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
williamr@2
   503
#  define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)  \
williamr@2
   504
             , BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
williamr@2
   505
williamr@2
   506
#else
williamr@2
   507
williamr@2
   508
// no workaround needed: expand to nothing
williamr@2
   509
williamr@2
   510
#  define BOOST_EXPLICIT_TEMPLATE_TYPE(t)
williamr@2
   511
#  define BOOST_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
williamr@2
   512
#  define BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
williamr@2
   513
#  define BOOST_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
williamr@2
   514
williamr@2
   515
#  define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)
williamr@2
   516
#  define BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
williamr@2
   517
#  define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
williamr@2
   518
#  define BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
williamr@2
   519
williamr@2
   520
williamr@2
   521
#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
williamr@2
   522
williamr@2
   523
williamr@2
   524
// ---------------------------------------------------------------------------//
williamr@2
   525
williamr@2
   526
//
williamr@2
   527
// Helper macro BOOST_STRINGIZE:
williamr@2
   528
// Converts the parameter X to a string after macro replacement
williamr@2
   529
// on X has been performed.
williamr@2
   530
//
williamr@2
   531
#define BOOST_STRINGIZE(X) BOOST_DO_STRINGIZE(X)
williamr@2
   532
#define BOOST_DO_STRINGIZE(X) #X
williamr@2
   533
williamr@2
   534
//
williamr@2
   535
// Helper macro BOOST_JOIN:
williamr@2
   536
// The following piece of macro magic joins the two
williamr@2
   537
// arguments together, even when one of the arguments is
williamr@2
   538
// itself a macro (see 16.3.1 in C++ standard).  The key
williamr@2
   539
// is that macro expansion of macro arguments does not
williamr@2
   540
// occur in BOOST_DO_JOIN2 but does in BOOST_DO_JOIN.
williamr@2
   541
//
williamr@2
   542
#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
williamr@2
   543
#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
williamr@2
   544
#define BOOST_DO_JOIN2( X, Y ) X##Y
williamr@2
   545
williamr@2
   546
//
williamr@2
   547
// Set some default values for compiler/library/platform names.
williamr@2
   548
// These are for debugging config setup only:
williamr@2
   549
//
williamr@2
   550
#  ifndef BOOST_COMPILER
williamr@2
   551
#     define BOOST_COMPILER "Unknown ISO C++ Compiler"
williamr@2
   552
#  endif
williamr@2
   553
#  ifndef BOOST_STDLIB
williamr@2
   554
#     define BOOST_STDLIB "Unknown ISO standard library"
williamr@2
   555
#  endif
williamr@2
   556
#  ifndef BOOST_PLATFORM
williamr@2
   557
#     if defined(unix) || defined(__unix) || defined(_XOPEN_SOURCE) \
williamr@2
   558
         || defined(_POSIX_SOURCE)
williamr@2
   559
#        define BOOST_PLATFORM "Generic Unix"
williamr@2
   560
#     else
williamr@2
   561
#        define BOOST_PLATFORM "Unknown"
williamr@2
   562
#     endif
williamr@2
   563
#  endif
williamr@2
   564
williamr@2
   565
#endif
williamr@2
   566
williamr@2
   567
williamr@2
   568
williamr@2
   569