Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:08:40

0001 /*
0002  *
0003  * Copyright (c) 1998-2002
0004  * John Maddock
0005  *
0006  * Use, modification and distribution are subject to the
0007  * Boost Software License, Version 1.0. (See accompanying file
0008  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009  *
0010  */
0011 
0012  /*
0013   *   LOCATION:    see http://www.boost.org for most recent version.
0014   *   FILE         config.hpp
0015   *   VERSION      see <boost/version.hpp>
0016   *   DESCRIPTION: regex extended config setup.
0017   */
0018 
0019 #ifndef BOOST_REGEX_CONFIG_HPP
0020 #define BOOST_REGEX_CONFIG_HPP
0021 
0022 #if !((__cplusplus >= 201103L) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(BOOST_REGEX_CXX03))
0023 #  define BOOST_REGEX_CXX03
0024 #endif
0025 
0026 #if defined(BOOST_REGEX_RECURSIVE) && !defined(BOOST_REGEX_CXX03)
0027 #  define BOOST_REGEX_CXX03
0028 #endif
0029 
0030 #if defined(__has_include)
0031 #if !defined(BOOST_REGEX_STANDALONE) && !__has_include(<boost/version.hpp>)
0032 #define BOOST_REGEX_STANDALONE
0033 #endif
0034 #endif
0035 
0036 /*
0037  * Borland C++ Fix/error check
0038  * this has to go *before* we include any std lib headers:
0039  */
0040 #if defined(__BORLANDC__) && !defined(__clang__)
0041 #  include <boost/regex/config/borland.hpp>
0042 #endif
0043 #ifndef BOOST_REGEX_STANDALONE
0044 #include <boost/version.hpp>
0045 #endif
0046 
0047 /*************************************************************************
0048 *
0049 * Asserts:
0050 *
0051 *************************************************************************/
0052 
0053 #ifdef BOOST_REGEX_STANDALONE
0054 #include <cassert>
0055 #  define BOOST_REGEX_ASSERT(x) assert(x)
0056 #else
0057 #include <boost/assert.hpp>
0058 #  define BOOST_REGEX_ASSERT(x) BOOST_ASSERT(x)
0059 #endif
0060 
0061 /*****************************************************************************
0062  *
0063  *  Include all the headers we need here:
0064  *
0065  ****************************************************************************/
0066 
0067 #ifdef __cplusplus
0068 
0069 #  ifndef BOOST_REGEX_USER_CONFIG
0070 #     define BOOST_REGEX_USER_CONFIG <boost/regex/user.hpp>
0071 #  endif
0072 
0073 #  include BOOST_REGEX_USER_CONFIG
0074 
0075 #ifndef BOOST_REGEX_STANDALONE
0076 #  include <boost/config.hpp>
0077 #  include <boost/predef.h>
0078 #endif
0079 
0080 #else
0081    /*
0082     * C build,
0083     * don't include <boost/config.hpp> because that may
0084     * do C++ specific things in future...
0085     */
0086 #  include <stdlib.h>
0087 #  include <stddef.h>
0088 #  ifdef _MSC_VER
0089 #     define BOOST_MSVC _MSC_VER
0090 #  endif
0091 #endif
0092 
0093 
0094 /****************************************************************************
0095 *
0096 * Legacy support:
0097 *
0098 *******************************************************************************/
0099 
0100 #if defined(BOOST_NO_STD_LOCALE) || defined(BOOST_NO_CXX11_HDR_MUTEX) || defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) \
0101    || defined(BOOST_NO_CXX11_HDR_ATOMIC) || defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_SMART_PTR) \
0102    || defined(BOOST_NO_CXX11_STATIC_ASSERT) || defined(BOOST_NO_NOEXCEPT)
0103 #ifndef BOOST_REGEX_CXX03
0104 #  define BOOST_REGEX_CXX03
0105 #endif
0106 #endif
0107 
0108 /*****************************************************************************
0109  *
0110  *  Boilerplate regex config options:
0111  *
0112  ****************************************************************************/
0113 
0114 /* Obsolete macro, use BOOST_VERSION instead: */
0115 #define BOOST_RE_VERSION 500
0116 
0117 /* fix: */
0118 #if defined(_UNICODE) && !defined(UNICODE)
0119 #define UNICODE
0120 #endif
0121 
0122 #define BOOST_REGEX_JOIN(X, Y) BOOST_REGEX_DO_JOIN(X, Y)
0123 #define BOOST_REGEX_DO_JOIN(X, Y) BOOST_REGEX_DO_JOIN2(X,Y)
0124 #define BOOST_REGEX_DO_JOIN2(X, Y) X##Y
0125 
0126 #ifdef BOOST_FALLTHROUGH
0127 #  define BOOST_REGEX_FALLTHROUGH BOOST_FALLTHROUGH
0128 #else
0129 
0130 #if defined(__clang__) && (__cplusplus >= 201103L) && defined(__has_warning)
0131 #  if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
0132 #    define BOOST_REGEX_FALLTHROUGH [[clang::fallthrough]]
0133 #  endif
0134 #endif
0135 #if !defined(BOOST_REGEX_FALLTHROUGH) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1800) && (__cplusplus >= 201703)
0136 #  define BOOST_REGEX_FALLTHROUGH [[fallthrough]]
0137 #endif
0138 #if !defined(BOOST_REGEX_FALLTHROUGH) && defined(__GNUC__) && (__GNUC__ >= 7)
0139 #  define BOOST_REGEX_FALLTHROUGH __attribute__((fallthrough))
0140 #endif
0141 
0142 #if !defined(BOOST_REGEX_FALLTHROUGH)
0143 #  define BOOST_REGEX_FALLTHROUGH
0144 #endif
0145 #endif
0146 
0147 #ifdef BOOST_NORETURN
0148 #  define BOOST_REGEX_NORETURN BOOST_NORETURN
0149 #else
0150 #  define BOOST_REGEX_NORETURN
0151 #endif
0152 
0153 
0154 /*
0155 * Define a macro for the namespace that details are placed in, this includes the Boost
0156 * version number to avoid mismatched header and library versions:
0157 */
0158 #define BOOST_REGEX_DETAIL_NS BOOST_REGEX_JOIN(re_detail_, BOOST_RE_VERSION)
0159 
0160 /*
0161  * Fix for gcc prior to 3.4: std::ctype<wchar_t> doesn't allow
0162  * masks to be combined, for example:
0163  * std::use_facet<std::ctype<wchar_t> >.is(std::ctype_base::lower|std::ctype_base::upper, L'a');
0164  * returns *false*.
0165  */
0166 #if defined(__GLIBCPP__) && defined(BOOST_REGEX_CXX03)
0167 #  define BOOST_REGEX_BUGGY_CTYPE_FACET
0168 #endif
0169 
0170 /*
0171  * If there isn't good enough wide character support then there will
0172  * be no wide character regular expressions:
0173  */
0174 #if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING))
0175 #  if !defined(BOOST_NO_WREGEX)
0176 #     define BOOST_NO_WREGEX
0177 #  endif
0178 #else
0179 #  if defined(__sgi) && (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))
0180       /* STLPort on IRIX is misconfigured: <cwctype> does not compile
0181        * as a temporary fix include <wctype.h> instead and prevent inclusion
0182        * of STLPort version of <cwctype> */
0183 #     include <wctype.h>
0184 #     define __STLPORT_CWCTYPE
0185 #     define _STLP_CWCTYPE
0186 #  endif
0187 
0188 #if defined(__cplusplus) && defined(BOOST_REGEX_CXX03)
0189 #  include <boost/regex/config/cwchar.hpp>
0190 #endif
0191 
0192 #endif
0193 
0194 /*
0195  * If Win32 support has been disabled for boost in general, then
0196  * it is for regex in particular:
0197  */
0198 #if defined(BOOST_DISABLE_WIN32) && !defined(BOOST_REGEX_NO_W32)
0199 #  define BOOST_REGEX_NO_W32
0200 #endif
0201 
0202 /* disable our own file-iterators and mapfiles if we can't
0203  * support them: */
0204 #if defined(_WIN32)
0205 #  if defined(BOOST_REGEX_NO_W32) || BOOST_PLAT_WINDOWS_RUNTIME
0206 #    define BOOST_REGEX_NO_FILEITER
0207 #  endif
0208 #else /* defined(_WIN32) */
0209 #  if !defined(BOOST_HAS_DIRENT_H)
0210 #    define BOOST_REGEX_NO_FILEITER
0211 #  endif
0212 #endif
0213 
0214 /* backwards compatibitity: */
0215 #if defined(BOOST_RE_NO_LIB)
0216 #  define BOOST_REGEX_NO_LIB
0217 #endif
0218 
0219 #if defined(__GNUC__) && !defined(_MSC_VER) && (defined(_WIN32) || defined(__CYGWIN__))
0220 /* gcc on win32 has problems if you include <windows.h>
0221    (sporadically generates bad code). */
0222 #  define BOOST_REGEX_NO_W32
0223 #endif
0224 #if defined(__COMO__) && !defined(BOOST_REGEX_NO_W32) && !defined(_MSC_EXTENSIONS)
0225 #  define BOOST_REGEX_NO_W32
0226 #endif
0227 
0228 #ifdef BOOST_REGEX_STANDALONE
0229 #  if defined(_MSC_VER) && !defined(__clang__) && !defined(__GNUC__)
0230 #     define BOOST_REGEX_MSVC _MSC_VER
0231 #endif
0232 #elif defined(BOOST_MSVC)
0233 #  define BOOST_REGEX_MSVC BOOST_MSVC
0234 #endif
0235 
0236 
0237 /*****************************************************************************
0238  *
0239  *  Set up dll import/export options:
0240  *
0241  ****************************************************************************/
0242 
0243 #if (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK) && defined(BOOST_SYMBOL_IMPORT)
0244 #  if defined(BOOST_REGEX_SOURCE)
0245 #     define BOOST_REGEX_BUILD_DLL
0246 #     define BOOST_REGEX_DECL BOOST_SYMBOL_EXPORT
0247 #  else
0248 #     define BOOST_REGEX_DECL BOOST_SYMBOL_IMPORT
0249 #  endif
0250 #else
0251 #  define BOOST_REGEX_DECL
0252 #endif
0253 
0254 #ifdef BOOST_REGEX_CXX03
0255 #if !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus)
0256 #  define BOOST_LIB_NAME boost_regex
0257 #  if defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
0258 #     define BOOST_DYN_LINK
0259 #  endif
0260 #  ifdef BOOST_REGEX_DIAG
0261 #     define BOOST_LIB_DIAGNOSTIC
0262 #  endif
0263 #  include <boost/config/auto_link.hpp>
0264 #endif
0265 #endif
0266 
0267 /*****************************************************************************
0268  *
0269  *  Set up function call type:
0270  *
0271  ****************************************************************************/
0272 
0273 #if defined(_MSC_VER) && defined(_MSC_EXTENSIONS)
0274 #if defined(_DEBUG) || defined(__MSVC_RUNTIME_CHECKS) || defined(_MANAGED) || defined(BOOST_REGEX_NO_FASTCALL)
0275 #  define BOOST_REGEX_CALL __cdecl
0276 #else
0277 #  define BOOST_REGEX_CALL __fastcall
0278 #endif
0279 #  define BOOST_REGEX_CCALL __cdecl
0280 #endif
0281 
0282 #if defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32)
0283 #if defined(__clang__)
0284 #  define BOOST_REGEX_CALL __cdecl
0285 #  define BOOST_REGEX_CCALL __cdecl
0286 #else
0287 #  define BOOST_REGEX_CALL __fastcall
0288 #  define BOOST_REGEX_CCALL __stdcall
0289 #endif
0290 #endif
0291 
0292 #ifndef BOOST_REGEX_CALL
0293 #  define BOOST_REGEX_CALL
0294 #endif
0295 #ifndef BOOST_REGEX_CCALL
0296 #define BOOST_REGEX_CCALL
0297 #endif
0298 
0299 /*****************************************************************************
0300  *
0301  *  Set up localisation model:
0302  *
0303  ****************************************************************************/
0304 
0305 /* backwards compatibility: */
0306 #ifdef BOOST_RE_LOCALE_C
0307 #  define BOOST_REGEX_USE_C_LOCALE
0308 #endif
0309 
0310 #ifdef BOOST_RE_LOCALE_CPP
0311 #  define BOOST_REGEX_USE_CPP_LOCALE
0312 #endif
0313 
0314 #if defined(__CYGWIN__)
0315 #  define BOOST_REGEX_USE_C_LOCALE
0316 #endif
0317 
0318 /* use C++ locale when targeting windows store */
0319 #if BOOST_PLAT_WINDOWS_RUNTIME
0320 #  define BOOST_REGEX_USE_CPP_LOCALE
0321 #  define BOOST_REGEX_NO_WIN32_LOCALE
0322 #endif
0323 
0324 /* Win32 defaults to native Win32 locale: */
0325 #if defined(_WIN32) && \
0326     !defined(BOOST_REGEX_USE_WIN32_LOCALE) && \
0327     !defined(BOOST_REGEX_USE_C_LOCALE) && \
0328     !defined(BOOST_REGEX_USE_CPP_LOCALE) && \
0329     !defined(BOOST_REGEX_NO_W32) && \
0330     !defined(BOOST_REGEX_NO_WIN32_LOCALE)
0331 #  define BOOST_REGEX_USE_WIN32_LOCALE
0332 #endif
0333 /* otherwise use C++ locale if supported: */
0334 #if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_NO_STD_LOCALE)
0335 #  define BOOST_REGEX_USE_CPP_LOCALE
0336 #endif
0337 /* otherwise use C locale: */
0338 #if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE)
0339 #  define BOOST_REGEX_USE_C_LOCALE
0340 #endif
0341 
0342 #ifndef BOOST_REGEX_MAX_STATE_COUNT
0343 #  define BOOST_REGEX_MAX_STATE_COUNT 100000000
0344 #endif
0345 
0346 
0347 /*****************************************************************************
0348  *
0349  *  Error Handling for exception free compilers:
0350  *
0351  ****************************************************************************/
0352 
0353 #ifdef BOOST_NO_EXCEPTIONS
0354 /*
0355  * If there are no exceptions then we must report critical-errors
0356  * the only way we know how; by terminating.
0357  */
0358 #include <stdexcept>
0359 #include <string>
0360 #include <boost/throw_exception.hpp>
0361 
0362 #  define BOOST_REGEX_NOEH_ASSERT(x)\
0363 if(0 == (x))\
0364 {\
0365    std::string s("Error: critical regex++ failure in: ");\
0366    s.append(#x);\
0367    std::runtime_error e(s);\
0368    boost::throw_exception(e);\
0369 }
0370 #else
0371 /*
0372  * With exceptions then error handling is taken care of and
0373  * there is no need for these checks:
0374  */
0375 #  define BOOST_REGEX_NOEH_ASSERT(x)
0376 #endif
0377 
0378 
0379 /*****************************************************************************
0380  *
0381  *  Stack protection under MS Windows:
0382  *
0383  ****************************************************************************/
0384 
0385 #if !defined(BOOST_REGEX_NO_W32) && !defined(BOOST_REGEX_V3)
0386 #  if(defined(_WIN32) || defined(_WIN64) || defined(_WINCE)) \
0387         && !(defined(__GNUC__) || defined(__BORLANDC__) && defined(__clang__)) \
0388         && !(defined(__BORLANDC__) && (__BORLANDC__ >= 0x600)) \
0389         && !(defined(__MWERKS__) && (__MWERKS__ <= 0x3003))
0390 #     define BOOST_REGEX_HAS_MS_STACK_GUARD
0391 #  endif
0392 #elif defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
0393 #  undef BOOST_REGEX_HAS_MS_STACK_GUARD
0394 #endif
0395 
0396 #if defined(__cplusplus) && defined(BOOST_REGEX_HAS_MS_STACK_GUARD)
0397 
0398 namespace boost{
0399 namespace BOOST_REGEX_DETAIL_NS{
0400 
0401 BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
0402 
0403 }
0404 }
0405 
0406 #endif
0407 
0408 
0409 /*****************************************************************************
0410  *
0411  *  Algorithm selection and configuration.
0412  *  These options are now obsolete for C++11 and later (regex v5).
0413  *
0414  ****************************************************************************/
0415 
0416 #if !defined(BOOST_REGEX_RECURSIVE) && !defined(BOOST_REGEX_NON_RECURSIVE)
0417 #  if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && !defined(_STLP_DEBUG) && !defined(__STL_DEBUG) && !(defined(_MSC_VER) && (_MSC_VER >= 1400)) && defined(BOOST_REGEX_CXX03)
0418 #     define BOOST_REGEX_RECURSIVE
0419 #  else
0420 #     define BOOST_REGEX_NON_RECURSIVE
0421 #  endif
0422 #endif
0423 
0424 #ifdef BOOST_REGEX_NON_RECURSIVE
0425 #  ifdef BOOST_REGEX_RECURSIVE
0426 #     error "Can't set both BOOST_REGEX_RECURSIVE and BOOST_REGEX_NON_RECURSIVE"
0427 #  endif
0428 #  ifndef BOOST_REGEX_BLOCKSIZE
0429 #     define BOOST_REGEX_BLOCKSIZE 4096
0430 #  endif
0431 #  if BOOST_REGEX_BLOCKSIZE < 512
0432 #     error "BOOST_REGEX_BLOCKSIZE must be at least 512"
0433 #  endif
0434 #  ifndef BOOST_REGEX_MAX_BLOCKS
0435 #     define BOOST_REGEX_MAX_BLOCKS 1024
0436 #  endif
0437 #  ifdef BOOST_REGEX_HAS_MS_STACK_GUARD
0438 #     undef BOOST_REGEX_HAS_MS_STACK_GUARD
0439 #  endif
0440 #  ifndef BOOST_REGEX_MAX_CACHE_BLOCKS
0441 #     define BOOST_REGEX_MAX_CACHE_BLOCKS 16
0442 #  endif
0443 #endif
0444 
0445 
0446 /*****************************************************************************
0447  *
0448  *  Diagnostics:
0449  *
0450  ****************************************************************************/
0451 
0452 #ifdef BOOST_REGEX_CONFIG_INFO
0453 BOOST_REGEX_DECL void BOOST_REGEX_CALL print_regex_library_info();
0454 #endif
0455 
0456 #if defined(BOOST_REGEX_DIAG)
0457 #  pragma message ("BOOST_REGEX_DECL" BOOST_STRINGIZE(=BOOST_REGEX_DECL))
0458 #  pragma message ("BOOST_REGEX_CALL" BOOST_STRINGIZE(=BOOST_REGEX_CALL))
0459 #  pragma message ("BOOST_REGEX_CCALL" BOOST_STRINGIZE(=BOOST_REGEX_CCALL))
0460 #ifdef BOOST_REGEX_USE_C_LOCALE
0461 #  pragma message ("Using C locale in regex traits class")
0462 #elif BOOST_REGEX_USE_CPP_LOCALE
0463 #  pragma message ("Using C++ locale in regex traits class")
0464 #else
0465 #  pragma message ("Using Win32 locale in regex traits class")
0466 #endif
0467 #if defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
0468 #  pragma message ("Dynamic linking enabled")
0469 #endif
0470 #if defined(BOOST_REGEX_NO_LIB) || defined(BOOST_ALL_NO_LIB)
0471 #  pragma message ("Auto-linking disabled")
0472 #endif
0473 #ifdef BOOST_REGEX_NO_EXTERNAL_TEMPLATES
0474 #  pragma message ("Extern templates disabled")
0475 #endif
0476 
0477 #endif
0478 
0479 #endif
0480