os/ossrv/ossrv_pub/boost_apis/boost/regex/config.hpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
 *
sl@0
     3
 * Copyright (c) 1998-2002
sl@0
     4
 * John Maddock
sl@0
     5
 *
sl@0
     6
 * Use, modification and distribution are subject to the
sl@0
     7
 * Boost Software License, Version 1.0. (See accompanying file
sl@0
     8
 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
sl@0
     9
 *
sl@0
    10
 */
sl@0
    11
sl@0
    12
 /*
sl@0
    13
  *   LOCATION:    see http://www.boost.org for most recent version.
sl@0
    14
  *   FILE         config.hpp
sl@0
    15
  *   VERSION      see <boost/version.hpp>
sl@0
    16
  *   DESCRIPTION: regex extended config setup.
sl@0
    17
  */
sl@0
    18
sl@0
    19
#ifndef BOOST_REGEX_CONFIG_HPP
sl@0
    20
#define BOOST_REGEX_CONFIG_HPP
sl@0
    21
/*
sl@0
    22
 * Borland C++ Fix/error check
sl@0
    23
 * this has to go *before* we include any std lib headers:
sl@0
    24
 */
sl@0
    25
#if defined(__BORLANDC__)
sl@0
    26
#  include <boost/regex/config/borland.hpp>
sl@0
    27
#endif
sl@0
    28
sl@0
    29
/*****************************************************************************
sl@0
    30
 *
sl@0
    31
 *  Include all the headers we need here:
sl@0
    32
 *
sl@0
    33
 ****************************************************************************/
sl@0
    34
sl@0
    35
#ifdef __cplusplus
sl@0
    36
sl@0
    37
#  ifndef BOOST_REGEX_USER_CONFIG
sl@0
    38
#     define BOOST_REGEX_USER_CONFIG <boost/regex/user.hpp>
sl@0
    39
#  endif
sl@0
    40
sl@0
    41
#  include BOOST_REGEX_USER_CONFIG
sl@0
    42
sl@0
    43
#  include <boost/config.hpp>
sl@0
    44
sl@0
    45
#else
sl@0
    46
   /*
sl@0
    47
    * C build,
sl@0
    48
    * don't include <boost/config.hpp> because that may
sl@0
    49
    * do C++ specific things in future...
sl@0
    50
    */
sl@0
    51
#  include <stdlib.h>
sl@0
    52
#  include <stddef.h>
sl@0
    53
#  ifdef _MSC_VER
sl@0
    54
#     define BOOST_MSVC _MSC_VER
sl@0
    55
#  endif
sl@0
    56
#endif
sl@0
    57
sl@0
    58
/*****************************************************************************
sl@0
    59
 *
sl@0
    60
 *  Boilerplate regex config options:
sl@0
    61
 *
sl@0
    62
 ****************************************************************************/
sl@0
    63
sl@0
    64
/* Obsolete macro, use BOOST_VERSION instead: */
sl@0
    65
#define BOOST_RE_VERSION 320
sl@0
    66
sl@0
    67
/* fix: */
sl@0
    68
#if defined(_UNICODE) && !defined(UNICODE)
sl@0
    69
#define UNICODE
sl@0
    70
#endif
sl@0
    71
sl@0
    72
/*
sl@0
    73
 * Fix for gcc prior to 3.4: std::ctype<wchar_t> doesn't allow
sl@0
    74
 * masks to be combined, for example:
sl@0
    75
 * std::use_facet<std::ctype<wchar_t> >.is(std::ctype_base::lower|std::ctype_base::upper, L'a');
sl@0
    76
 * returns *false*.
sl@0
    77
 */
sl@0
    78
#ifdef __GLIBCPP__
sl@0
    79
#  define BOOST_REGEX_BUGGY_CTYPE_FACET
sl@0
    80
#endif
sl@0
    81
sl@0
    82
/*
sl@0
    83
 * Intel C++ before 8.0 ends up with unresolved externals unless we turn off
sl@0
    84
 * extern template support:
sl@0
    85
 */
sl@0
    86
#if defined(BOOST_INTEL) && defined(__cplusplus) && (BOOST_INTEL <= 800)
sl@0
    87
#  define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
sl@0
    88
#endif
sl@0
    89
sl@0
    90
/*
sl@0
    91
 * If there isn't good enough wide character support then there will
sl@0
    92
 * be no wide character regular expressions:
sl@0
    93
 */
sl@0
    94
#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING))
sl@0
    95
#  if !defined(BOOST_NO_WREGEX)
sl@0
    96
#     define BOOST_NO_WREGEX
sl@0
    97
#  endif
sl@0
    98
#else
sl@0
    99
#  if defined(__sgi) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
sl@0
   100
      /* STLPort on IRIX is misconfigured: <cwctype> does not compile
sl@0
   101
       * as a temporary fix include <wctype.h> instead and prevent inclusion
sl@0
   102
       * of STLPort version of <cwctype> */
sl@0
   103
#     include <wctype.h>
sl@0
   104
#     define __STLPORT_CWCTYPE
sl@0
   105
#     define _STLP_CWCTYPE
sl@0
   106
#  endif
sl@0
   107
sl@0
   108
#ifdef __cplusplus
sl@0
   109
#  include <boost/regex/config/cwchar.hpp>
sl@0
   110
#endif
sl@0
   111
sl@0
   112
#endif
sl@0
   113
sl@0
   114
/*
sl@0
   115
 * If Win32 support has been disabled for boost in general, then
sl@0
   116
 * it is for regex in particular:
sl@0
   117
 */
sl@0
   118
#if defined(BOOST_DISABLE_WIN32) && !defined(BOOST_REGEX_NO_W32)
sl@0
   119
#  define BOOST_REGEX_NO_W32
sl@0
   120
#endif
sl@0
   121
sl@0
   122
/* disable our own file-iterators and mapfiles if we can't
sl@0
   123
 * support them: */
sl@0
   124
#if !defined(BOOST_HAS_DIRENT_H) && !(defined(_WIN32) && !defined(BOOST_REGEX_NO_W32))
sl@0
   125
#  define BOOST_REGEX_NO_FILEITER
sl@0
   126
#endif
sl@0
   127
sl@0
   128
/* backwards compatibitity: */
sl@0
   129
#if defined(BOOST_RE_NO_LIB)
sl@0
   130
#  define BOOST_REGEX_NO_LIB
sl@0
   131
#endif
sl@0
   132
sl@0
   133
#if defined(__GNUC__) && (defined(_WIN32) || defined(__CYGWIN__))
sl@0
   134
/* gcc on win32 has problems if you include <windows.h>
sl@0
   135
   (sporadically generates bad code). */
sl@0
   136
#  define BOOST_REGEX_NO_W32
sl@0
   137
#endif
sl@0
   138
#if defined(__COMO__) && !defined(BOOST_REGEX_NO_W32) && !defined(_MSC_EXTENSIONS)
sl@0
   139
#  define BOOST_REGEX_NO_W32
sl@0
   140
#endif
sl@0
   141
sl@0
   142
/*****************************************************************************
sl@0
   143
 *
sl@0
   144
 *  Wide character workarounds:
sl@0
   145
 *
sl@0
   146
 ****************************************************************************/
sl@0
   147
sl@0
   148
/*
sl@0
   149
 * define BOOST_REGEX_HAS_OTHER_WCHAR_T when wchar_t is a native type, but the users
sl@0
   150
 * code may be built with wchar_t as unsigned short: basically when we're building
sl@0
   151
 * with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions
sl@0
   152
 * of the non-inline functions in the library, so that users can still link to the lib,
sl@0
   153
 * irrespective of whether their own code is built with /Zc:wchar_t.
sl@0
   154
 */
sl@0
   155
#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
sl@0
   156
#  define BOOST_REGEX_HAS_OTHER_WCHAR_T
sl@0
   157
#  ifdef BOOST_MSVC
sl@0
   158
#     pragma warning(push)
sl@0
   159
#     pragma warning(disable : 4251 4231 4660)
sl@0
   160
#  endif
sl@0
   161
#  ifdef _DLL
sl@0
   162
#     include <string>
sl@0
   163
      extern template class __declspec(dllimport) std::basic_string<unsigned short>;
sl@0
   164
#  endif
sl@0
   165
#  ifdef BOOST_MSVC
sl@0
   166
#     pragma warning(pop)
sl@0
   167
#  endif
sl@0
   168
#endif
sl@0
   169
sl@0
   170
sl@0
   171
/*****************************************************************************
sl@0
   172
 *
sl@0
   173
 *  Set up dll import/export options:
sl@0
   174
 *
sl@0
   175
 ****************************************************************************/
sl@0
   176
sl@0
   177
#if defined(BOOST_HAS_DECLSPEC) && (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK)
sl@0
   178
#  if defined(BOOST_REGEX_SOURCE)
sl@0
   179
#     define BOOST_REGEX_DECL __declspec(dllexport)
sl@0
   180
#     define BOOST_REGEX_BUILD_DLL
sl@0
   181
#  else
sl@0
   182
#     define BOOST_REGEX_DECL __declspec(dllimport)
sl@0
   183
#  endif
sl@0
   184
#endif
sl@0
   185
sl@0
   186
#ifndef BOOST_REGEX_DECL
sl@0
   187
#  define BOOST_REGEX_DECL
sl@0
   188
#endif
sl@0
   189
sl@0
   190
#if !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus)
sl@0
   191
#  define BOOST_LIB_NAME boost_regex
sl@0
   192
#  if defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
sl@0
   193
#     define BOOST_DYN_LINK
sl@0
   194
#  endif
sl@0
   195
#  ifdef BOOST_REGEX_DIAG
sl@0
   196
#     define BOOST_LIB_DIAGNOSTIC
sl@0
   197
#  endif
sl@0
   198
#  include <boost/config/auto_link.hpp>
sl@0
   199
#endif
sl@0
   200
sl@0
   201
/*****************************************************************************
sl@0
   202
 *
sl@0
   203
 *  Set up function call type:
sl@0
   204
 *
sl@0
   205
 ****************************************************************************/
sl@0
   206
sl@0
   207
#if defined(BOOST_MSVC) && (BOOST_MSVC >= 1200) && defined(_MSC_EXTENSIONS)
sl@0
   208
#if defined(_DEBUG) || defined(__MSVC_RUNTIME_CHECKS) || defined(_MANAGED)
sl@0
   209
#  define BOOST_REGEX_CALL __cdecl
sl@0
   210
#else
sl@0
   211
#  define BOOST_REGEX_CALL __fastcall
sl@0
   212
#endif
sl@0
   213
#  define BOOST_REGEX_CCALL __cdecl
sl@0
   214
#endif
sl@0
   215
sl@0
   216
#if defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)
sl@0
   217
#  define BOOST_REGEX_CALL __fastcall
sl@0
   218
#  define BOOST_REGEX_CCALL __stdcall
sl@0
   219
#endif
sl@0
   220
sl@0
   221
#ifndef BOOST_REGEX_CALL
sl@0
   222
#  define BOOST_REGEX_CALL
sl@0
   223
#endif
sl@0
   224
#ifndef BOOST_REGEX_CCALL
sl@0
   225
#define BOOST_REGEX_CCALL
sl@0
   226
#endif
sl@0
   227
sl@0
   228
/*****************************************************************************
sl@0
   229
 *
sl@0
   230
 *  Set up localisation model:
sl@0
   231
 *
sl@0
   232
 ****************************************************************************/
sl@0
   233
sl@0
   234
/* backwards compatibility: */
sl@0
   235
#ifdef BOOST_RE_LOCALE_C
sl@0
   236
#  define BOOST_REGEX_USE_C_LOCALE
sl@0
   237
#endif
sl@0
   238
sl@0
   239
#ifdef BOOST_RE_LOCALE_CPP
sl@0
   240
#  define BOOST_REGEX_USE_CPP_LOCALE
sl@0
   241
#endif
sl@0
   242
sl@0
   243
/* Win32 defaults to native Win32 locale: */
sl@0
   244
#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
sl@0
   245
#  define BOOST_REGEX_USE_WIN32_LOCALE
sl@0
   246
#endif
sl@0
   247
/* otherwise use C++ locale if supported: */
sl@0
   248
#if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_NO_STD_LOCALE)
sl@0
   249
#  define BOOST_REGEX_USE_CPP_LOCALE
sl@0
   250
#endif
sl@0
   251
/* otherwise use C+ locale: */
sl@0
   252
#if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE)
sl@0
   253
#  define BOOST_REGEX_USE_C_LOCALE
sl@0
   254
#endif
sl@0
   255
sl@0
   256
#ifndef BOOST_REGEX_MAX_STATE_COUNT
sl@0
   257
#  define BOOST_REGEX_MAX_STATE_COUNT 100000000
sl@0
   258
#endif
sl@0
   259
sl@0
   260
sl@0
   261
/*****************************************************************************
sl@0
   262
 *
sl@0
   263
 *  Error Handling for exception free compilers:
sl@0
   264
 *
sl@0
   265
 ****************************************************************************/
sl@0
   266
sl@0
   267
#ifdef BOOST_NO_EXCEPTIONS
sl@0
   268
/*
sl@0
   269
 * If there are no exceptions then we must report critical-errors
sl@0
   270
 * the only way we know how; by terminating.
sl@0
   271
 */
sl@0
   272
#include <stdexcept>
sl@0
   273
#include <string>
sl@0
   274
#include <boost/throw_exception.hpp>
sl@0
   275
sl@0
   276
#  define BOOST_REGEX_NOEH_ASSERT(x)\
sl@0
   277
if(0 == (x))\
sl@0
   278
{\
sl@0
   279
   std::string s("Error: critical regex++ failure in: ");\
sl@0
   280
   s.append(#x);\
sl@0
   281
   std::runtime_error e(s);\
sl@0
   282
   boost::throw_exception(e);\
sl@0
   283
}
sl@0
   284
#else
sl@0
   285
/*
sl@0
   286
 * With exceptions then error handling is taken care of and
sl@0
   287
 * there is no need for these checks:
sl@0
   288
 */
sl@0
   289
#  define BOOST_REGEX_NOEH_ASSERT(x)
sl@0
   290
#endif
sl@0
   291
sl@0
   292
sl@0
   293
/*****************************************************************************
sl@0
   294
 *
sl@0
   295
 *  Stack protection under MS Windows:
sl@0
   296
 *
sl@0
   297
 ****************************************************************************/
sl@0
   298
sl@0
   299
#if !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_V3)
sl@0
   300
#  if(defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \
sl@0
   301
        && !defined(__GNUC__) \
sl@0
   302
        && !(defined(__BORLANDC__) && (__BORLANDC__ >= 0x600)) \
sl@0
   303
        && !(defined(__MWERKS__) && (__MWERKS__ <= 0x3003))
sl@0
   304
#     define BOOST_REGEX_HAS_MS_STACK_GUARD
sl@0
   305
#  endif
sl@0
   306
#elif defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
sl@0
   307
#  undef BOOST_REGEX_HAS_MS_STACK_GUARD
sl@0
   308
#endif
sl@0
   309
sl@0
   310
#if defined(__cplusplus) && defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
sl@0
   311
sl@0
   312
namespace boost{
sl@0
   313
namespace re_detail{
sl@0
   314
sl@0
   315
BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
sl@0
   316
sl@0
   317
}
sl@0
   318
}
sl@0
   319
sl@0
   320
#endif
sl@0
   321
sl@0
   322
sl@0
   323
/*****************************************************************************
sl@0
   324
 *
sl@0
   325
 *  Algorithm selection and configuration:
sl@0
   326
 *
sl@0
   327
 ****************************************************************************/
sl@0
   328
sl@0
   329
#if !defined(BOOST_REGEX_RECURSIVE) && !defined(BOOST_REGEX_NON_RECURSIVE)
sl@0
   330
#  if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && !defined(_STLP_DEBUG) && !defined(__STL_DEBUG) && !(defined(BOOST_MSVC) && (BOOST_MSVC >= 1400))
sl@0
   331
#     define BOOST_REGEX_RECURSIVE
sl@0
   332
#  else
sl@0
   333
#     define BOOST_REGEX_NON_RECURSIVE
sl@0
   334
#  endif
sl@0
   335
#endif
sl@0
   336
sl@0
   337
#ifdef BOOST_REGEX_NON_RECURSIVE
sl@0
   338
#  ifdef BOOST_REGEX_RECURSIVE
sl@0
   339
#     error "Can't set both BOOST_REGEX_RECURSIVE and BOOST_REGEX_NON_RECURSIVE"
sl@0
   340
#  endif
sl@0
   341
#  ifndef BOOST_REGEX_BLOCKSIZE
sl@0
   342
#     define BOOST_REGEX_BLOCKSIZE 4096
sl@0
   343
#  endif
sl@0
   344
#  if BOOST_REGEX_BLOCKSIZE < 512
sl@0
   345
#     error "BOOST_REGEX_BLOCKSIZE must be at least 512"
sl@0
   346
#  endif
sl@0
   347
#  ifndef BOOST_REGEX_MAX_BLOCKS
sl@0
   348
#     define BOOST_REGEX_MAX_BLOCKS 1024
sl@0
   349
#  endif
sl@0
   350
#  ifdef BOOST_REGEX_HAS_MS_STACK_GUARD
sl@0
   351
#     undef BOOST_REGEX_HAS_MS_STACK_GUARD
sl@0
   352
#  endif
sl@0
   353
#  ifndef BOOST_REGEX_MAX_CACHE_BLOCKS
sl@0
   354
#     define BOOST_REGEX_MAX_CACHE_BLOCKS 16
sl@0
   355
#  endif
sl@0
   356
#endif
sl@0
   357
sl@0
   358
sl@0
   359
/*****************************************************************************
sl@0
   360
 *
sl@0
   361
 *  helper memory allocation functions:
sl@0
   362
 *
sl@0
   363
 ****************************************************************************/
sl@0
   364
sl@0
   365
#if defined(__cplusplus) && defined(BOOST_REGEX_NON_RECURSIVE)
sl@0
   366
namespace boost{ namespace re_detail{
sl@0
   367
sl@0
   368
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block();
sl@0
   369
BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*);
sl@0
   370
sl@0
   371
}} /* namespaces */
sl@0
   372
#endif
sl@0
   373
sl@0
   374
/*****************************************************************************
sl@0
   375
 *
sl@0
   376
 *  Diagnostics:
sl@0
   377
 *
sl@0
   378
 ****************************************************************************/
sl@0
   379
sl@0
   380
#ifdef BOOST_REGEX_CONFIG_INFO
sl@0
   381
BOOST_REGEX_DECL void BOOST_REGEX_CALL print_regex_library_info();
sl@0
   382
#endif
sl@0
   383
sl@0
   384
#if defined(BOOST_REGEX_DIAG)
sl@0
   385
#  pragma message ("BOOST_REGEX_DECL" BOOST_STRINGIZE(=BOOST_REGEX_DECL))
sl@0
   386
#  pragma message ("BOOST_REGEX_CALL" BOOST_STRINGIZE(=BOOST_REGEX_CALL))
sl@0
   387
#  pragma message ("BOOST_REGEX_CCALL" BOOST_STRINGIZE(=BOOST_REGEX_CCALL))
sl@0
   388
#ifdef BOOST_REGEX_USE_C_LOCALE
sl@0
   389
#  pragma message ("Using C locale in regex traits class")
sl@0
   390
#elif BOOST_REGEX_USE_CPP_LOCALE
sl@0
   391
#  pragma message ("Using C++ locale in regex traits class")
sl@0
   392
#else
sl@0
   393
#  pragma message ("Using Win32 locale in regex traits class")
sl@0
   394
#endif
sl@0
   395
#if defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
sl@0
   396
#  pragma message ("Dynamic linking enabled")
sl@0
   397
#endif
sl@0
   398
#if defined(BOOST_REGEX_NO_LIB) || defined(BOOST_ALL_NO_LIB)
sl@0
   399
#  pragma message ("Auto-linking disabled")
sl@0
   400
#endif
sl@0
   401
#ifdef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
sl@0
   402
#  pragma message ("Extern templates disabled")
sl@0
   403
#endif
sl@0
   404
sl@0
   405
#endif
sl@0
   406
sl@0
   407
#endif
sl@0
   408
sl@0
   409
sl@0
   410
sl@0
   411