]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/regex/config.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / regex / config.hpp
index 9b75d507e6381706a851bdc08eb924e60c314769..bed485fa1203a3664fe9c66f487c9436475d9ba9 100644 (file)
 
 #ifndef BOOST_REGEX_CONFIG_HPP
 #define BOOST_REGEX_CONFIG_HPP
+
+#if !((__cplusplus >= 201103L) || (defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(BOOST_REGEX_CXX03))
+#  define BOOST_REGEX_CXX03
+#endif
+
+#if defined(BOOST_REGEX_RECURSIVE) && !defined(BOOST_REGEX_CXX03)
+#  define BOOST_REGEX_CXX03
+#endif
+
+#if defined(__has_include)
+#if !defined(BOOST_REGEX_STANDALONE) && !__has_include(<boost/version.hpp>)
+#define BOOST_REGEX_STANDALONE
+#endif
+#endif
+
 /*
  * Borland C++ Fix/error check
  * this has to go *before* we include any std lib headers:
 #if defined(__BORLANDC__) && !defined(__clang__)
 #  include <boost/regex/config/borland.hpp>
 #endif
+#ifndef BOOST_REGEX_STANDALONE
 #include <boost/version.hpp>
+#endif
+
+/*************************************************************************
+*
+* Asserts:
+*
+*************************************************************************/
+
+#ifdef BOOST_REGEX_STANDALONE
+#include <cassert>
+#  define BOOST_REGEX_ASSERT(x) assert(x)
+#else
+#include <boost/assert.hpp>
+#  define BOOST_REGEX_ASSERT(x) BOOST_ASSERT(x)
+#endif
 
 /*****************************************************************************
  *
 
 #  include BOOST_REGEX_USER_CONFIG
 
+#ifndef BOOST_REGEX_STANDALONE
 #  include <boost/config.hpp>
 #  include <boost/predef.h>
+#endif
 
 #else
    /*
 #  endif
 #endif
 
+
+/****************************************************************************
+*
+* Legacy support:
+*
+*******************************************************************************/
+
+#if defined(BOOST_NO_STD_LOCALE) || defined(BOOST_NO_CXX11_HDR_MUTEX) || defined(BOOST_NO_CXX11_HDR_TYPE_TRAITS) \
+   || defined(BOOST_NO_CXX11_HDR_ATOMIC) || defined(BOOST_NO_CXX11_ALLOCATOR) || defined(BOOST_NO_CXX11_SMART_PTR) \
+   || defined(BOOST_NO_CXX11_STATIC_ASSERT) || defined(BOOST_NO_NOEXCEPT)
+#ifndef BOOST_REGEX_CXX03
+#  define BOOST_REGEX_CXX03
+#endif
+#endif
+
 /*****************************************************************************
  *
  *  Boilerplate regex config options:
  ****************************************************************************/
 
 /* Obsolete macro, use BOOST_VERSION instead: */
-#define BOOST_RE_VERSION 320
+#define BOOST_RE_VERSION 500
 
 /* fix: */
 #if defined(_UNICODE) && !defined(UNICODE)
 #define UNICODE
 #endif
 
+#define BOOST_REGEX_JOIN(X, Y) BOOST_REGEX_DO_JOIN(X, Y)
+#define BOOST_REGEX_DO_JOIN(X, Y) BOOST_REGEX_DO_JOIN2(X,Y)
+#define BOOST_REGEX_DO_JOIN2(X, Y) X##Y
+
+#ifdef BOOST_FALLTHROUGH
+#  define BOOST_REGEX_FALLTHROUGH BOOST_FALLTHROUGH
+#else
+
+#if defined(__clang__) && (__cplusplus >= 201103L) && defined(__has_warning)
+#  if __has_feature(cxx_attributes) && __has_warning("-Wimplicit-fallthrough")
+#    define BOOST_REGEX_FALLTHROUGH [[clang::fallthrough]]
+#  endif
+#endif
+#if !defined(BOOST_REGEX_FALLTHROUGH) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 1800) && (__cplusplus >= 201703)
+#  define BOOST_REGEX_FALLTHROUGH [[fallthrough]]
+#endif
+#if !defined(BOOST_REGEX_FALLTHROUGH) && defined(__GNUC__) && (__GNUC__ >= 7)
+#  define BOOST_REGEX_FALLTHROUGH __attribute__((fallthrough))
+#endif
+
+#if !defined(BOOST_REGEX_FALLTHROUGH)
+#  define BOOST_REGEX_FALLTHROUGH
+#endif
+#endif
+
+#ifdef BOOST_NORETURN
+#  define BOOST_REGEX_NORETURN BOOST_NORETURN
+#else
+#  define BOOST_REGEX_NORETURN
+#endif
+
 
 /*
 * Define a macro for the namespace that details are placed in, this includes the Boost
 * version number to avoid mismatched header and library versions:
 */
-#define BOOST_REGEX_DETAIL_NS BOOST_JOIN(re_detail_, BOOST_VERSION)
+#define BOOST_REGEX_DETAIL_NS BOOST_REGEX_JOIN(re_detail_, BOOST_RE_VERSION)
 
 /*
  * Fix for gcc prior to 3.4: std::ctype<wchar_t> doesn't allow
  * std::use_facet<std::ctype<wchar_t> >.is(std::ctype_base::lower|std::ctype_base::upper, L'a');
  * returns *false*.
  */
-#ifdef __GLIBCPP__
+#if defined(__GLIBCPP__) && defined(BOOST_REGEX_CXX03)
 #  define BOOST_REGEX_BUGGY_CTYPE_FACET
 #endif
 
-/*
- * Intel C++ before 8.0 ends up with unresolved externals unless we turn off
- * extern template support:
- */
-#if defined(BOOST_INTEL) && defined(__cplusplus) && (BOOST_INTEL <= 800)
-#  define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
-#endif
-/*
- * Visual C++ doesn't support external templates with C++ extensions turned off:
- */
-#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
-#  define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
-#endif
- /*
- * Oracle compiler in C++11 mode doesn't like external templates for some reason:
- */
-#ifdef __SUNPRO_CC
-#  define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
-#endif
- /*
- * Shared regex lib will crash without this, frankly it looks a lot like a gcc bug:
- */
-#if defined(__MINGW32__)
-#  define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
-#endif
-/*
- * Clang fails to export template instances with -fvisibility=hidden, see
- * https://github.com/boostorg/regex/issues/49
- */
-#ifdef __clang__
-#  define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
-#endif
-#ifdef __CYGWIN__
-/* We get multiply defined symbols without this: */
-#  define BOOST_REGEX_NO_EXTERNAL_TEMPLATES
-#endif
-
 /*
  * If there isn't good enough wide character support then there will
  * be no wide character regular expressions:
 #     define _STLP_CWCTYPE
 #  endif
 
-#ifdef __cplusplus
+#if defined(__cplusplus) && defined(BOOST_REGEX_CXX03)
 #  include <boost/regex/config/cwchar.hpp>
 #endif
 
 #  define BOOST_REGEX_NO_W32
 #endif
 
-/*****************************************************************************
- *
- *  Wide character workarounds:
- *
- ****************************************************************************/
-
-/*
- * define BOOST_REGEX_HAS_OTHER_WCHAR_T when wchar_t is a native type, but the users
- * code may be built with wchar_t as unsigned short: basically when we're building
- * with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions
- * of the non-inline functions in the library, so that users can still link to the lib,
- * irrespective of whether their own code is built with /Zc:wchar_t.
- * Note that this does NOT WORK with VC10 and VC14 when the C++ locale is in effect as
- * the locale's <unsigned short> facets simply do not compile in that case.
- * As we default to the C++ locale when compiling for the windows runtime we
- * skip in this case aswell.
- */
-#if defined(__cplusplus) && \
-      (defined(BOOST_MSVC) || defined(__ICL)) && \
-      !defined(BOOST_NO_INTRINSIC_WCHAR_T) && \
-      defined(BOOST_WINDOWS) && \
-      !defined(__SGI_STL_PORT) && \
-      !defined(_STLPORT_VERSION) && \
-      !defined(BOOST_RWSTD_VER) && \
-      ((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE)) && \
-      !BOOST_PLAT_WINDOWS_RUNTIME
-#  define BOOST_REGEX_HAS_OTHER_WCHAR_T
-#  ifdef BOOST_MSVC
-#     pragma warning(push)
-#     pragma warning(disable : 4251)
-#if BOOST_MSVC < 1700
-#     pragma warning(disable : 4231)
-#endif
-#     if BOOST_MSVC < 1600
-#        pragma warning(disable : 4660)
-#     endif
-#  endif
-#  if defined(_DLL) && defined(BOOST_MSVC) && (BOOST_MSVC < 1600)
-#     include <string>
-      extern template class __declspec(dllimport) std::basic_string<unsigned short>;
-#  endif
-#  ifdef BOOST_MSVC
-#     pragma warning(pop)
-#  endif
+#ifdef BOOST_REGEX_STANDALONE
+#  if defined(_MSC_VER) && !defined(__clang__) && !defined(__GNUC__)
+#     define BOOST_REGEX_MSVC _MSC_VER
+#endif
+#elif defined(BOOST_MSVC)
+#  define BOOST_REGEX_MSVC BOOST_MSVC
 #endif
 
 
  *
  ****************************************************************************/
 
-#ifndef BOOST_SYMBOL_EXPORT
-#  define BOOST_SYMBOL_EXPORT
-#  define BOOST_SYMBOL_IMPORT
-#endif
-
-#if (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK)
+#if (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK) && defined(BOOST_SYMBOL_IMPORT)
 #  if defined(BOOST_REGEX_SOURCE)
-#     define BOOST_REGEX_DECL BOOST_SYMBOL_EXPORT
 #     define BOOST_REGEX_BUILD_DLL
+#     define BOOST_REGEX_DECL BOOST_SYMBOL_EXPORT
 #  else
 #     define BOOST_REGEX_DECL BOOST_SYMBOL_IMPORT
 #  endif
 #  define BOOST_REGEX_DECL
 #endif
 
+#ifdef BOOST_REGEX_CXX03
 #if !defined(BOOST_REGEX_NO_LIB) && !defined(BOOST_REGEX_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus)
 #  define BOOST_LIB_NAME boost_regex
 #  if defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
 #  endif
 #  include <boost/config/auto_link.hpp>
 #endif
+#endif
 
 /*****************************************************************************
  *
 #if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_NO_STD_LOCALE)
 #  define BOOST_REGEX_USE_CPP_LOCALE
 #endif
-/* otherwise use C+ locale: */
+/* otherwise use C locale: */
 #if !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE)
 #  define BOOST_REGEX_USE_C_LOCALE
 #endif
@@ -407,12 +408,13 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
 
 /*****************************************************************************
  *
- *  Algorithm selection and configuration:
+ *  Algorithm selection and configuration.
+ *  These options are now obsolete for C++11 and later (regex v5).
  *
  ****************************************************************************/
 
 #if !defined(BOOST_REGEX_RECURSIVE) && !defined(BOOST_REGEX_NON_RECURSIVE)
-#  if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && !defined(_STLP_DEBUG) && !defined(__STL_DEBUG) && !(defined(_MSC_VER) && (_MSC_VER >= 1400))
+#  if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && !defined(_STLP_DEBUG) && !defined(__STL_DEBUG) && !(defined(_MSC_VER) && (_MSC_VER >= 1400)) && defined(BOOST_REGEX_CXX03)
 #     define BOOST_REGEX_RECURSIVE
 #  else
 #     define BOOST_REGEX_NON_RECURSIVE
@@ -441,21 +443,6 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page();
 #endif
 
 
-/*****************************************************************************
- *
- *  helper memory allocation functions:
- *
- ****************************************************************************/
-
-#if defined(__cplusplus) && defined(BOOST_REGEX_NON_RECURSIVE)
-namespace boost{ namespace BOOST_REGEX_DETAIL_NS{
-
-BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block();
-BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void*);
-
-}} /* namespaces */
-#endif
-
 /*****************************************************************************
  *
  *  Diagnostics:
@@ -491,6 +478,3 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL print_regex_library_info();
 
 #endif
 
-
-
-