diff --git a/boostregex/boost/assert/source_location.hpp b/boostregex/boost/assert/source_location.hpp index c6c3e78f4..162d788da 100644 --- a/boostregex/boost/assert/source_location.hpp +++ b/boostregex/boost/assert/source_location.hpp @@ -1,16 +1,18 @@ #ifndef BOOST_ASSERT_SOURCE_LOCATION_HPP_INCLUDED #define BOOST_ASSERT_SOURCE_LOCATION_HPP_INCLUDED -// http://www.boost.org/libs/assert +// http://www.boost.org/libs/assert // -// Copyright 2019 Peter Dimov -// Distributed under the Boost Software License, Version 1.0. -// http://www.boost.org/LICENSE_1_0.txt +// Copyright 2019, 2021 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// http://www.boost.org/LICENSE_1_0.txt #include #include #include #include +#include +#include namespace boost { @@ -53,28 +55,48 @@ public: { return column_; } + +#if defined(BOOST_MSVC) +# pragma warning( push ) +# pragma warning( disable: 4996 ) +#endif + + std::string to_string() const + { + if( line() == 0 ) + { + return "(unknown source location)"; + } + + std::string r = file_name(); + + char buffer[ 16 ]; + + std::sprintf( buffer, ":%ld", static_cast( line() ) ); + r += buffer; + + if( column() ) + { + std::sprintf( buffer, ":%ld", static_cast( column() ) ); + r += buffer; + } + + r += " in function '"; + r += function_name(); + r += '\''; + + return r; + } + +#if defined(BOOST_MSVC) +# pragma warning( pop ) +#endif + }; template std::basic_ostream & operator<<( std::basic_ostream & os, source_location const & loc ) { - os.width( 0 ); - - if( loc.line() == 0 ) - { - os << "(unknown source location)"; - } - else - { - os << loc.file_name() << ':' << loc.line(); - - if( loc.column() ) - { - os << ':' << loc.column(); - } - - os << ": in function '" << loc.function_name() << '\''; - } - + os << loc.to_string(); return os; } diff --git a/boostregex/boost/config/assert_cxx03.hpp b/boostregex/boost/config/assert_cxx03.hpp index 34fb832dc..03074733e 100644 --- a/boostregex/boost/config/assert_cxx03.hpp +++ b/boostregex/boost/config/assert_cxx03.hpp @@ -1,6 +1,6 @@ -// This file was automatically generated on Wed Mar 3 12:23:02 2021 +// This file was automatically generated on Tue Aug 17 16:27:31 2021 // by libs/config/tools/generate.cpp -// Copyright John Maddock 2002-4. +// Copyright John Maddock 2002-21. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -20,9 +20,6 @@ #ifdef BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS # error "Your compiler appears not to be fully C++03 compliant. Detected via defect macro BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS." #endif -#ifdef BOOST_NO_AUTO_PTR -# error "Your compiler appears not to be fully C++03 compliant. Detected via defect macro BOOST_NO_AUTO_PTR." -#endif #ifdef BOOST_NO_COMPLETE_VALUE_INITIALIZATION # error "Your compiler appears not to be fully C++03 compliant. Detected via defect macro BOOST_NO_COMPLETE_VALUE_INITIALIZATION." #endif diff --git a/boostregex/boost/config/assert_cxx11.hpp b/boostregex/boost/config/assert_cxx11.hpp index c2f43a6eb..bf036c850 100644 --- a/boostregex/boost/config/assert_cxx11.hpp +++ b/boostregex/boost/config/assert_cxx11.hpp @@ -1,6 +1,6 @@ -// This file was automatically generated on Wed Mar 3 12:23:02 2021 +// This file was automatically generated on Tue Aug 17 16:27:31 2021 // by libs/config/tools/generate.cpp -// Copyright John Maddock 2002-4. +// Copyright John Maddock 2002-21. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -21,9 +21,6 @@ #ifdef BOOST_NO_CXX11_ALLOCATOR # error "Your compiler appears not to be fully C++11 compliant. Detected via defect macro BOOST_NO_CXX11_ALLOCATOR." #endif -#ifdef BOOST_NO_CXX11_ATOMIC_SMART_PTR -# error "Your compiler appears not to be fully C++11 compliant. Detected via defect macro BOOST_NO_CXX11_ATOMIC_SMART_PTR." -#endif #ifdef BOOST_NO_CXX11_AUTO_DECLARATIONS # error "Your compiler appears not to be fully C++11 compliant. Detected via defect macro BOOST_NO_CXX11_AUTO_DECLARATIONS." #endif @@ -78,9 +75,6 @@ #ifdef BOOST_NO_CXX11_HDR_CHRONO # error "Your compiler appears not to be fully C++11 compliant. Detected via defect macro BOOST_NO_CXX11_HDR_CHRONO." #endif -#ifdef BOOST_NO_CXX11_HDR_CODECVT -# error "Your compiler appears not to be fully C++11 compliant. Detected via defect macro BOOST_NO_CXX11_HDR_CODECVT." -#endif #ifdef BOOST_NO_CXX11_HDR_CONDITION_VARIABLE # error "Your compiler appears not to be fully C++11 compliant. Detected via defect macro BOOST_NO_CXX11_HDR_CONDITION_VARIABLE." #endif diff --git a/boostregex/boost/config/assert_cxx14.hpp b/boostregex/boost/config/assert_cxx14.hpp index 18892db46..8af5c9ebb 100644 --- a/boostregex/boost/config/assert_cxx14.hpp +++ b/boostregex/boost/config/assert_cxx14.hpp @@ -1,6 +1,6 @@ -// This file was automatically generated on Wed Mar 3 12:23:02 2021 +// This file was automatically generated on Tue Aug 17 16:27:31 2021 // by libs/config/tools/generate.cpp -// Copyright John Maddock 2002-4. +// Copyright John Maddock 2002-21. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/boostregex/boost/config/assert_cxx17.hpp b/boostregex/boost/config/assert_cxx17.hpp index 3a0e019ca..03c1a5dc6 100644 --- a/boostregex/boost/config/assert_cxx17.hpp +++ b/boostregex/boost/config/assert_cxx17.hpp @@ -1,6 +1,6 @@ -// This file was automatically generated on Wed Mar 3 12:23:02 2021 +// This file was automatically generated on Tue Aug 17 16:27:31 2021 // by libs/config/tools/generate.cpp -// Copyright John Maddock 2002-4. +// Copyright John Maddock 2002-21. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/boostregex/boost/config/assert_cxx20.hpp b/boostregex/boost/config/assert_cxx20.hpp new file mode 100644 index 000000000..97aa757b6 --- /dev/null +++ b/boostregex/boost/config/assert_cxx20.hpp @@ -0,0 +1,56 @@ +// This file was automatically generated on Tue Aug 17 16:27:31 2021 +// by libs/config/tools/generate.cpp +// Copyright John Maddock 2002-21. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/config for the most recent version.// +// Revision $Id$ +// + +#include +#include + +#ifdef BOOST_NO_CXX20_HDR_BARRIER +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_BARRIER." +#endif +#ifdef BOOST_NO_CXX20_HDR_BIT +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_BIT." +#endif +#ifdef BOOST_NO_CXX20_HDR_COMPARE +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_COMPARE." +#endif +#ifdef BOOST_NO_CXX20_HDR_CONCEPTS +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_CONCEPTS." +#endif +#ifdef BOOST_NO_CXX20_HDR_COROUTINE +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_COROUTINE." +#endif +#ifdef BOOST_NO_CXX20_HDR_FORMAT +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_FORMAT." +#endif +#ifdef BOOST_NO_CXX20_HDR_LATCH +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_LATCH." +#endif +#ifdef BOOST_NO_CXX20_HDR_NUMBERS +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_NUMBERS." +#endif +#ifdef BOOST_NO_CXX20_HDR_RANGES +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_RANGES." +#endif +#ifdef BOOST_NO_CXX20_HDR_SEMAPHORE +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_SEMAPHORE." +#endif +#ifdef BOOST_NO_CXX20_HDR_SOURCE_LOCATION +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_SOURCE_LOCATION." +#endif +#ifdef BOOST_NO_CXX20_HDR_SPAN +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_SPAN." +#endif +#ifdef BOOST_NO_CXX20_HDR_STOP_TOKEN +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_STOP_TOKEN." +#endif +#ifdef BOOST_NO_CXX20_HDR_SYNCSTREAM +# error "Your compiler appears not to be fully C++20 compliant. Detected via defect macro BOOST_NO_CXX20_HDR_SYNCSTREAM." +#endif diff --git a/boostregex/boost/config/auto_link.hpp b/boostregex/boost/config/auto_link.hpp index 1ea6faa77..64dee1ef1 100644 --- a/boostregex/boost/config/auto_link.hpp +++ b/boostregex/boost/config/auto_link.hpp @@ -182,19 +182,20 @@ BOOST_LIB_SUFFIX: Static/import libraries extension (".lib", ".a") for the c // vc14.1: # define BOOST_LIB_TOOLSET "vc141" -# elif defined(BOOST_MSVC) +# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1930) // vc14.2: # define BOOST_LIB_TOOLSET "vc142" +# elif defined(BOOST_MSVC) + + // vc14.3: +# define BOOST_LIB_TOOLSET "vc143" + # elif defined(BOOST_EMBTC_WINDOWS) // Embarcadero Clang based compilers: -# if defined(BOOST_EMBTC_WIN32C) -# define BOOST_LIB_TOOLSET "bcb32" -# elif defined(BOOST_EMBTC_WIN64) -# define BOOST_LIB_TOOLSET "bcb64" -# endif +# define BOOST_LIB_TOOLSET "embtc" # elif defined(BOOST_BORLANDC) diff --git a/boostregex/boost/config/compiler/clang.hpp b/boostregex/boost/config/compiler/clang.hpp index 9d8ba7d71..f28da1072 100644 --- a/boostregex/boost/config/compiler/clang.hpp +++ b/boostregex/boost/config/compiler/clang.hpp @@ -351,3 +351,5 @@ // Macro used to identify the Clang compiler. #define BOOST_CLANG 1 +// BOOST_CLANG_VERSION +#include diff --git a/boostregex/boost/config/compiler/clang_version.hpp b/boostregex/boost/config/compiler/clang_version.hpp new file mode 100644 index 000000000..9e5b408ae --- /dev/null +++ b/boostregex/boost/config/compiler/clang_version.hpp @@ -0,0 +1,77 @@ +// Copyright 2021 Peter Dimov +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt) + +#if !defined(__APPLE__) + +# define BOOST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) + +#else +# define BOOST_CLANG_REPORTED_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) + +// https://en.wikipedia.org/wiki/Xcode#Toolchain_versions + +# if BOOST_CLANG_REPORTED_VERSION >= 130000 +# define BOOST_CLANG_VERSION 120000 + +# elif BOOST_CLANG_REPORTED_VERSION >= 120005 +# define BOOST_CLANG_VERSION 110100 + +# elif BOOST_CLANG_REPORTED_VERSION >= 120000 +# define BOOST_CLANG_VERSION 100000 + +# elif BOOST_CLANG_REPORTED_VERSION >= 110003 +# define BOOST_CLANG_VERSION 90000 + +# elif BOOST_CLANG_REPORTED_VERSION >= 110000 +# define BOOST_CLANG_VERSION 80000 + +# elif BOOST_CLANG_REPORTED_VERSION >= 100001 +# define BOOST_CLANG_VERSION 70000 + +# elif BOOST_CLANG_REPORTED_VERSION >= 100000 +# define BOOST_CLANG_VERSION 60001 + +# elif BOOST_CLANG_REPORTED_VERSION >= 90100 +# define BOOST_CLANG_VERSION 50002 + +# elif BOOST_CLANG_REPORTED_VERSION >= 90000 +# define BOOST_CLANG_VERSION 40000 + +# elif BOOST_CLANG_REPORTED_VERSION >= 80000 +# define BOOST_CLANG_VERSION 30900 + +# elif BOOST_CLANG_REPORTED_VERSION >= 70300 +# define BOOST_CLANG_VERSION 30800 + +# elif BOOST_CLANG_REPORTED_VERSION >= 70000 +# define BOOST_CLANG_VERSION 30700 + +# elif BOOST_CLANG_REPORTED_VERSION >= 60100 +# define BOOST_CLANG_VERSION 30600 + +# elif BOOST_CLANG_REPORTED_VERSION >= 60000 +# define BOOST_CLANG_VERSION 30500 + +# elif BOOST_CLANG_REPORTED_VERSION >= 50100 +# define BOOST_CLANG_VERSION 30400 + +# elif BOOST_CLANG_REPORTED_VERSION >= 50000 +# define BOOST_CLANG_VERSION 30300 + +# elif BOOST_CLANG_REPORTED_VERSION >= 40200 +# define BOOST_CLANG_VERSION 30200 + +# elif BOOST_CLANG_REPORTED_VERSION >= 30100 +# define BOOST_CLANG_VERSION 30100 + +# elif BOOST_CLANG_REPORTED_VERSION >= 20100 +# define BOOST_CLANG_VERSION 30000 + +# else +# define BOOST_CLANG_VERSION 20900 + +# endif + +# undef BOOST_CLANG_REPORTED_VERSION +#endif diff --git a/boostregex/boost/config/compiler/common_edg.hpp b/boostregex/boost/config/compiler/common_edg.hpp index 6597cd2ac..7887b30a2 100644 --- a/boostregex/boost/config/compiler/common_edg.hpp +++ b/boostregex/boost/config/compiler/common_edg.hpp @@ -77,31 +77,20 @@ #define BOOST_NO_CXX11_AUTO_DECLARATIONS #define BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS -#define BOOST_NO_CXX11_CHAR16_T -#define BOOST_NO_CXX11_CHAR32_T -#define BOOST_NO_CXX11_CONSTEXPR -#define BOOST_NO_CXX11_DECLTYPE -#define BOOST_NO_CXX11_DECLTYPE_N3276 #define BOOST_NO_CXX11_DEFAULTED_FUNCTIONS #define BOOST_NO_CXX11_DELETED_FUNCTIONS #define BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS -#define BOOST_NO_CXX11_LAMBDAS #define BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS #define BOOST_NO_CXX11_NOEXCEPT #define BOOST_NO_CXX11_NULLPTR -#define BOOST_NO_CXX11_RANGE_BASED_FOR -#define BOOST_NO_CXX11_RAW_LITERALS #define BOOST_NO_CXX11_RVALUE_REFERENCES #define BOOST_NO_CXX11_SCOPED_ENUMS #define BOOST_NO_SFINAE_EXPR #define BOOST_NO_CXX11_SFINAE_EXPR #define BOOST_NO_CXX11_STATIC_ASSERT #define BOOST_NO_CXX11_TEMPLATE_ALIASES -#define BOOST_NO_CXX11_UNICODE_LITERALS -#define BOOST_NO_CXX11_VARIADIC_TEMPLATES #define BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX -#define BOOST_NO_CXX11_USER_DEFINED_LITERALS #define BOOST_NO_CXX11_ALIGNAS #define BOOST_NO_CXX11_TRAILING_RESULT_TYPES #define BOOST_NO_CXX11_INLINE_NAMESPACES @@ -111,6 +100,37 @@ #define BOOST_NO_CXX11_THREAD_LOCAL #define BOOST_NO_CXX11_UNRESTRICTED_UNION +//__cpp_decltype 200707 possibly? +#define BOOST_NO_CXX11_DECLTYPE +#define BOOST_NO_CXX11_DECLTYPE_N3276 + +#if !defined(__cpp_unicode_characters) || (__cpp_unicode_characters < 200704) +# define BOOST_NO_CXX11_CHAR16_T +# define BOOST_NO_CXX11_CHAR32_T +#endif +#if !defined(__cpp_unicode_literals) || (__cpp_unicode_literals < 200710) +# define BOOST_NO_CXX11_UNICODE_LITERALS +#endif +#if !defined(__cpp_user_defined_literals) || (__cpp_user_defined_literals < 200809) +# define BOOST_NO_CXX11_USER_DEFINED_LITERALS +#endif +#if !defined(__cpp_variadic_templates) || (__cpp_variadic_templates < 200704) +# define BOOST_NO_CXX11_VARIADIC_TEMPLATES +#endif +#if !defined(__cpp_constexpr) || (__cpp_constexpr < 200907) +# define BOOST_NO_CXX11_CONSTEXPR +#endif +#if !defined(__cpp_lambdas) || (__cpp_lambdas < 200907) +# define BOOST_NO_CXX11_LAMBDAS +#endif +#if !defined(__cpp_range_based_for) || (__cpp_range_based_for < 200710) +# define BOOST_NO_CXX11_RANGE_BASED_FOR +#endif +#if !defined(__cpp_raw_strings) || (__cpp_raw_strings < 200610) +# define BOOST_NO_CXX11_RAW_LITERALS +#endif + + // C++ 14: #if !defined(__cpp_aggregate_nsdmi) || (__cpp_aggregate_nsdmi < 201304) # define BOOST_NO_CXX14_AGGREGATE_NSDMI diff --git a/boostregex/boost/config/compiler/gcc.hpp b/boostregex/boost/config/compiler/gcc.hpp index eb8843e90..d4cf0e9c8 100644 --- a/boostregex/boost/config/compiler/gcc.hpp +++ b/boostregex/boost/config/compiler/gcc.hpp @@ -323,9 +323,10 @@ # define BOOST_FALLTHROUGH __attribute__((fallthrough)) #endif -#if defined(__MINGW32__) && !defined(__MINGW64__) -// Currently (March 2019) thread_local is broken on mingw for all current 32bit compiler releases, see +#if (__GNUC__ < 11) && defined(__MINGW32__) && !defined(__MINGW64__) +// thread_local was broken on mingw for all 32bit compiler releases prior to 11.x, see // https://sourceforge.net/p/mingw-w64/bugs/527/ +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83562 // Not setting this causes program termination on thread exit. #define BOOST_NO_CXX11_THREAD_LOCAL #endif diff --git a/boostregex/boost/config/compiler/nvcc.hpp b/boostregex/boost/config/compiler/nvcc.hpp index ed035fcf7..419dd724a 100644 --- a/boostregex/boost/config/compiler/nvcc.hpp +++ b/boostregex/boost/config/compiler/nvcc.hpp @@ -22,6 +22,7 @@ // BOOST_GPU_ENABLED : Flag a function or a method as being enabled on the host and device #define BOOST_GPU_ENABLED __host__ __device__ +#if !defined(__clang__) || defined(__NVCC__) // A bug in version 7.0 of CUDA prevents use of variadic templates in some occasions // https://svn.boost.org/trac/boost/ticket/11897 // This is fixed in 7.5. As the following version macro was introduced in 7.5 an existance @@ -38,6 +39,8 @@ # define BOOST_NO_CXX11_CONSTEXPR #endif +#endif + #ifdef __CUDACC__ // // When compiing .cu files, there's a bunch of stuff that doesn't work with msvc: diff --git a/boostregex/boost/config/compiler/visualc.hpp b/boostregex/boost/config/compiler/visualc.hpp index 7612b47e2..4859c7c81 100644 --- a/boostregex/boost/config/compiler/visualc.hpp +++ b/boostregex/boost/config/compiler/visualc.hpp @@ -236,7 +236,9 @@ // if this is in effect or not, in any case nothing in Boost is currently using this, so we'll just go // on defining it for now: // +#if (_MSC_FULL_VER < 193030705) || (_MSVC_LANG < 202004) # define BOOST_NO_TWO_PHASE_NAME_LOOKUP +#endif #if (_MSC_VER < 1912) || (_MSVC_LANG < 201402) // Supported from msvc-15.5 onwards: diff --git a/boostregex/boost/config/compiler/xlcpp.hpp b/boostregex/boost/config/compiler/xlcpp.hpp index c24b2c516..6e8688171 100644 --- a/boostregex/boost/config/compiler/xlcpp.hpp +++ b/boostregex/boost/config/compiler/xlcpp.hpp @@ -288,3 +288,4 @@ // Macro used to identify the Clang compiler. #define BOOST_CLANG 1 +#define BOOST_CLANG_VERSION (__clang_major__ * 10000 + __clang_minor__ * 100 + __clang_patchlevel__) diff --git a/boostregex/boost/config/detail/cxx_composite.hpp b/boostregex/boost/config/detail/cxx_composite.hpp index 7f6c1a0a9..618be6b93 100644 --- a/boostregex/boost/config/detail/cxx_composite.hpp +++ b/boostregex/boost/config/detail/cxx_composite.hpp @@ -1,6 +1,6 @@ -// This file was automatically generated on Wed Mar 3 12:23:02 2021 +// This file was automatically generated on Tue Aug 17 16:27:31 2021 // by libs/config/tools/generate.cpp -// Copyright John Maddock 2002-4. +// Copyright John Maddock 2002-21. // Use, modification and distribution are subject to the // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -12,7 +12,6 @@ #if defined(BOOST_NO_ADL_BARRIER)\ || defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP)\ || defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)\ - || defined(BOOST_NO_AUTO_PTR)\ || defined(BOOST_NO_COMPLETE_VALUE_INITIALIZATION)\ || defined(BOOST_NO_CTYPE_FUNCTIONS)\ || defined(BOOST_NO_CV_SPECIALIZATIONS)\ @@ -83,7 +82,6 @@ || defined(BOOST_NO_CXX11_ADDRESSOF)\ || defined(BOOST_NO_CXX11_ALIGNAS)\ || defined(BOOST_NO_CXX11_ALLOCATOR)\ - || defined(BOOST_NO_CXX11_ATOMIC_SMART_PTR)\ || defined(BOOST_NO_CXX11_AUTO_DECLARATIONS)\ || defined(BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS)\ || defined(BOOST_NO_CXX11_CHAR16_T)\ @@ -102,7 +100,6 @@ || defined(BOOST_NO_CXX11_HDR_ARRAY)\ || defined(BOOST_NO_CXX11_HDR_ATOMIC)\ || defined(BOOST_NO_CXX11_HDR_CHRONO)\ - || defined(BOOST_NO_CXX11_HDR_CODECVT)\ || defined(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE)\ || defined(BOOST_NO_CXX11_HDR_EXCEPTION)\ || defined(BOOST_NO_CXX11_HDR_FORWARD_LIST)\ @@ -184,3 +181,21 @@ # define BOOST_NO_CXX17 #endif +#if defined(BOOST_NO_CXX17)\ + || defined(BOOST_NO_CXX20_HDR_BARRIER)\ + || defined(BOOST_NO_CXX20_HDR_BIT)\ + || defined(BOOST_NO_CXX20_HDR_COMPARE)\ + || defined(BOOST_NO_CXX20_HDR_CONCEPTS)\ + || defined(BOOST_NO_CXX20_HDR_COROUTINE)\ + || defined(BOOST_NO_CXX20_HDR_FORMAT)\ + || defined(BOOST_NO_CXX20_HDR_LATCH)\ + || defined(BOOST_NO_CXX20_HDR_NUMBERS)\ + || defined(BOOST_NO_CXX20_HDR_RANGES)\ + || defined(BOOST_NO_CXX20_HDR_SEMAPHORE)\ + || defined(BOOST_NO_CXX20_HDR_SOURCE_LOCATION)\ + || defined(BOOST_NO_CXX20_HDR_SPAN)\ + || defined(BOOST_NO_CXX20_HDR_STOP_TOKEN)\ + || defined(BOOST_NO_CXX20_HDR_SYNCSTREAM) +# define BOOST_NO_CXX20 +#endif + diff --git a/boostregex/boost/config/detail/select_platform_config.hpp b/boostregex/boost/config/detail/select_platform_config.hpp index b36eca57a..dbff74aaf 100644 --- a/boostregex/boost/config/detail/select_platform_config.hpp +++ b/boostregex/boost/config/detail/select_platform_config.hpp @@ -88,6 +88,11 @@ #elif defined(__CloudABI__) // Nuxi CloudABI: # define BOOST_PLATFORM_CONFIG "boost/config/platform/cloudabi.hpp" + +#elif defined (__wasm__) +// Web assembly: +# define BOOST_PLATFORM_CONFIG "boost/config/platform/wasm.hpp" + #else # if defined(unix) \ diff --git a/boostregex/boost/config/detail/suffix.hpp b/boostregex/boost/config/detail/suffix.hpp index a8a90ad71..a6e287c76 100644 --- a/boostregex/boost/config/detail/suffix.hpp +++ b/boostregex/boost/config/detail/suffix.hpp @@ -475,6 +475,16 @@ namespace std { # define BOOST_CTOR_TYPENAME #endif +// +// If we're on a CUDA device (note DEVICE not HOST, irrespective of compiler) then disable __int128 and __float128 support if present: +// +#if defined(__CUDA_ARCH__) && defined(BOOST_HAS_FLOAT128) +# undef BOOST_HAS_FLOAT128 +#endif +#if defined(__CUDA_ARCH__) && defined(BOOST_HAS_INT128) +# undef BOOST_HAS_INT128 +#endif + // long long workaround ------------------------------------------// // On gcc (and maybe other compilers?) long long is alway supported // but it's use may generate either warnings (with -ansi), or errors @@ -622,6 +632,9 @@ namespace std{ using ::type_info; } // nvcc doesn't always parse __noinline__, // see: https://svn.boost.org/trac/boost/ticket/9392 # define BOOST_NOINLINE __attribute__ ((noinline)) +# elif defined(HIP_VERSION) + // See https://github.com/boostorg/config/issues/392 +# define BOOST_NOINLINE __attribute__ ((noinline)) # else # define BOOST_NOINLINE __attribute__ ((__noinline__)) # endif @@ -1040,7 +1053,7 @@ namespace std{ using ::type_info; } #endif #elif defined(__has_cpp_attribute) // clang-6 accepts [[nodiscard]] with -std=c++14, but warns about it -pedantic -#if __has_cpp_attribute(nodiscard) && !(defined(__clang__) && (__cplusplus < 201703L)) +#if __has_cpp_attribute(nodiscard) && !(defined(__clang__) && (__cplusplus < 201703L)) && !(defined(__GNUC__) && (__cplusplus < 201100)) # define BOOST_ATTRIBUTE_NODISCARD [[nodiscard]] #endif #if __has_cpp_attribute(no_unique_address) && !(defined(__GNUC__) && (__cplusplus < 201100)) @@ -1123,6 +1136,80 @@ namespace std{ using ::type_info; } #endif #endif +#if !defined(_YVALS) && !defined(_CPPLIB_VER) // msvc std lib already configured +#if (!defined(__has_include) || (__cplusplus < 201704)) +# define BOOST_NO_CXX20_HDR_BARRIER +# define BOOST_NO_CXX20_HDR_FORMAT +# define BOOST_NO_CXX20_HDR_SOURCE_LOCATION +# define BOOST_NO_CXX20_HDR_BIT +# define BOOST_NO_CXX20_HDR_LATCH +# define BOOST_NO_CXX20_HDR_SPAN +# define BOOST_NO_CXX20_HDR_COMPARE +# define BOOST_NO_CXX20_HDR_NUMBERS +# define BOOST_NO_CXX20_HDR_STOP_TOKEN +# define BOOST_NO_CXX20_HDR_CONCEPTS +# define BOOST_NO_CXX20_HDR_RANGES +# define BOOST_NO_CXX20_HDR_SYNCSTREAM +# define BOOST_NO_CXX20_HDR_COROUTINE +# define BOOST_NO_CXX20_HDR_SEMAPHORE +#else +#if !__has_include() +# define BOOST_NO_CXX20_HDR_BARRIER +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_FORMAT +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_SOURCE_LOCATION +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_BIT +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_LATCH +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_SPAN +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_COMPARE +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_NUMBERS +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_STOP_TOKEN +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_CONCEPTS +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_RANGES +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_SYNCSTREAM +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_COROUTINE +#endif +#if !__has_include() +# define BOOST_NO_CXX20_HDR_SEMAPHORE +#endif +#endif +#endif + +// +// Define composite agregate macros: +// +#include + +// +// Define the std level that the compiler claims to support: +// +#ifndef BOOST_CXX_VERSION +# define BOOST_CXX_VERSION __cplusplus +#endif + // // Define composite agregate macros: // diff --git a/boostregex/boost/config/platform/bsd.hpp b/boostregex/boost/config/platform/bsd.hpp index 79e74a080..ccc7eb05a 100644 --- a/boostregex/boost/config/platform/bsd.hpp +++ b/boostregex/boost/config/platform/bsd.hpp @@ -28,7 +28,8 @@ // FreeBSD has but does not // advertise the fact in : // -#if (defined(__FreeBSD__) && (__FreeBSD__ >= 3)) || defined(__DragonFly__) +#if (defined(__FreeBSD__) && (__FreeBSD__ >= 3)) \ + || defined(__OpenBSD__) || defined(__DragonFly__) # define BOOST_HAS_NL_TYPES_H #endif @@ -56,7 +57,8 @@ #endif #if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \ - || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) || defined(__DragonFly__)) + || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) \ + || defined(__OpenBSD__) || defined(__DragonFly__)) # define BOOST_NO_CWCHAR #endif // @@ -74,13 +76,8 @@ #define BOOST_HAS_GETTIMEOFDAY #define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE #define BOOST_HAS_SIGACTION +#define BOOST_HAS_CLOCK_GETTIME // boilerplate code: #define BOOST_HAS_UNISTD_H #include - - - - - - diff --git a/boostregex/boost/config/platform/wasm.hpp b/boostregex/boost/config/platform/wasm.hpp new file mode 100644 index 000000000..682b84859 --- /dev/null +++ b/boostregex/boost/config/platform/wasm.hpp @@ -0,0 +1,23 @@ +// (C) Copyright John Maddock 2020. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for most recent version. + +// WASM specific config options: + +#define BOOST_PLATFORM "Wasm" + +#ifdef __has_include +#if __has_include() +# define BOOST_HAS_UNISTD_H +#endif +#endif + +// boilerplate code: +#include +// +// fenv lacks the C++11 macros: +// +#define BOOST_NO_FENV_H diff --git a/boostregex/boost/config/stdlib/dinkumware.hpp b/boostregex/boost/config/stdlib/dinkumware.hpp index 40eb66797..a9d3706c0 100644 --- a/boostregex/boost/config/stdlib/dinkumware.hpp +++ b/boostregex/boost/config/stdlib/dinkumware.hpp @@ -192,6 +192,30 @@ # define BOOST_NO_CXX17_STD_INVOKE #endif +// C++20 features +#if !defined(_MSVC_STL_UPDATE) || (_MSVC_STL_UPDATE < 202008L) || !defined(_HAS_CXX20) || (_HAS_CXX20 == 0) +# define BOOST_NO_CXX20_HDR_BARRIER +# define BOOST_NO_CXX20_HDR_BIT +# define BOOST_NO_CXX20_HDR_LATCH +# define BOOST_NO_CXX20_HDR_SPAN +# define BOOST_NO_CXX20_HDR_COMPARE +# define BOOST_NO_CXX20_HDR_NUMBERS +# define BOOST_NO_CXX20_HDR_CONCEPTS +# define BOOST_NO_CXX20_HDR_COROUTINE +# define BOOST_NO_CXX20_HDR_SEMAPHORE +#endif +#if !defined(_MSVC_STL_UPDATE) || (_MSVC_STL_UPDATE < 202011L) || !defined(_HAS_CXX20) || (_HAS_CXX20 == 0) +# define BOOST_NO_CXX20_HDR_STOP_TOKEN +#endif +// C++20 features not yet implemented: +# define BOOST_NO_CXX20_HDR_FORMAT +#if !defined(_MSVC_STL_UPDATE) || (_MSVC_STL_UPDATE < 202108L) || !defined(_HAS_CXX20) || (_HAS_CXX20 == 0) +# define BOOST_NO_CXX20_HDR_SOURCE_LOCATION +# define BOOST_NO_CXX20_HDR_SYNCSTREAM +#endif +// Incomplete: +# define BOOST_NO_CXX20_HDR_RANGES + #if !(!defined(_CPPLIB_VER) || (_CPPLIB_VER < 650) || !defined(BOOST_MSVC) || (BOOST_MSVC < 1912) || !defined(_HAS_CXX17) || (_HAS_CXX17 == 0)) // Deprecated std::iterator: # define BOOST_NO_STD_ITERATOR @@ -212,7 +236,15 @@ // Bug specific to VC14, // See https://connect.microsoft.com/VisualStudio/feedback/details/1348277/link-error-when-using-std-codecvt-utf8-utf16-char16-t // and discussion here: http://blogs.msdn.com/b/vcblog/archive/2014/11/12/visual-studio-2015-preview-now-available.aspx?PageIndex=2 -#if defined(_CPPLIB_VER) && (_CPPLIB_VER == 650) +#if defined(_CPPLIB_VER) && (_CPPLIB_VER == 650) && (!defined(_MSVC_STL_VERSION) || (_MSVC_STL_VERSION < 142)) +# define BOOST_NO_CXX11_HDR_CODECVT +#endif + +#if (_MSVC_LANG > 201700) && !defined(BOOST_NO_CXX11_HDR_CODECVT) +// +// is deprected as of C++17, and by default MSVC emits hard errors +// if you try to use it, so mark it as unavailable: +// # define BOOST_NO_CXX11_HDR_CODECVT #endif @@ -227,6 +259,12 @@ # define BOOST_NO_CXX98_BINDERS # endif #endif +// +// Things deprecated in C++20: +// +#if defined(_HAS_CXX20) +# define BOOST_NO_CXX11_ATOMIC_SMART_PTR +#endif // diff --git a/boostregex/boost/config/stdlib/libcpp.hpp b/boostregex/boost/config/stdlib/libcpp.hpp index ed51c0584..fe4a48d21 100644 --- a/boostregex/boost/config/stdlib/libcpp.hpp +++ b/boostregex/boost/config/stdlib/libcpp.hpp @@ -106,6 +106,7 @@ #ifdef __has_include #if __has_include() +#include #if !defined(__cpp_lib_execution) || (__cpp_lib_execution < 201603L) # define BOOST_NO_CXX17_HDR_EXECUTION @@ -114,6 +115,57 @@ #define BOOST_NO_CXX17_STD_INVOKE #endif +#if !defined(__cpp_lib_bit_cast) || (__cpp_lib_bit_cast < 201806L) || !defined(__cpp_lib_bitops) || (__cpp_lib_bitops < 201907L) || !defined(__cpp_lib_endian) || (__cpp_lib_endian < 201907L) +# define BOOST_NO_CXX20_HDR_BIT +#endif +#if !defined(__cpp_lib_three_way_comparison) || (__cpp_lib_three_way_comparison < 201907L) +# define BOOST_NO_CXX20_HDR_COMPARE +#endif +#if !defined(__cpp_lib_ranges) || (__cpp_lib_ranges < 201911L) +# define BOOST_NO_CXX20_HDR_RANGES +#endif +#if !defined(__cpp_lib_barrier) || (__cpp_lib_barrier < 201907L) +# define BOOST_NO_CXX20_HDR_BARRIER +#endif +#if !defined(__cpp_lib_format) || (__cpp_lib_format < 201907L) +# define BOOST_NO_CXX20_HDR_FORMAT +#endif +#if !defined(__cpp_lib_source_location) || (__cpp_lib_source_location < 201907L) +# define BOOST_NO_CXX20_HDR_SOURCE_LOCATION +#endif +#if !defined(__cpp_lib_latch) || (__cpp_lib_latch < 201907L) +# define BOOST_NO_CXX20_HDR_SOURCE_LATCH +#endif +#if !defined(__cpp_lib_span) || (__cpp_lib_span < 202002L) +# define BOOST_NO_CXX20_HDR_SOURCE_SPAN +#endif +#if !defined(__cpp_lib_math_constants) || (__cpp_lib_math_constants < 201907L) +# define BOOST_NO_CXX20_HDR_SOURCE_NUMBERS +#endif +#if !defined(__cpp_lib_jthread) || (__cpp_lib_jthread < 201911L) +# define BOOST_NO_CXX20_HDR_SOURCE_STOP_TOKEN +#endif +#if !defined(__cpp_lib_concepts) || (__cpp_lib_concepts < 202002L) +# define BOOST_NO_CXX20_HDR_SOURCE_STOP_CONCEPTS +#endif +#if !defined(__cpp_lib_syncbuf) || (__cpp_lib_syncbuf < 201803L) +# define BOOST_NO_CXX20_HDR_SYNCSTREAM +#endif +#if !defined(__cpp_lib_coroutine) || (__cpp_lib_coroutine < 201902L) +# define BOOST_NO_CXX20_HDR_COROUTINE +#endif +#if !defined(__cpp_lib_semaphore) || (__cpp_lib_semaphore < 201907L) +# define BOOST_NO_CXX20_HDR_SEMAPHORE +#endif +#if !defined(__cpp_lib_concepts) || (__cpp_lib_concepts < 202002L) +# define BOOST_NO_CXX20_HDR_CONCEPTS +#endif + +#if(_LIBCPP_VERSION < 9000) && !defined(BOOST_NO_CXX20_HDR_SPAN) +// as_writable_bytes is missing. +# define BOOST_NO_CXX20_HDR_SPAN +#endif + #else #define BOOST_NO_CXX17_STD_INVOKE // Invoke support is incomplete (no invoke_result) #define BOOST_NO_CXX17_HDR_EXECUTION diff --git a/boostregex/boost/config/stdlib/libstdcpp3.hpp b/boostregex/boost/config/stdlib/libstdcpp3.hpp index 834775b58..abcdad54b 100644 --- a/boostregex/boost/config/stdlib/libstdcpp3.hpp +++ b/boostregex/boost/config/stdlib/libstdcpp3.hpp @@ -166,6 +166,23 @@ #elif __has_include() # define BOOST_LIBSTDCXX_VERSION 40300 #endif +// +// If BOOST_HAS_FLOAT128 is set, now that we know the std lib is libstdc++3, check to see if the std lib is +// configured to support this type. If not disable it: +// +#if defined(BOOST_HAS_FLOAT128) && !defined(_GLIBCXX_USE_FLOAT128) +# undef BOOST_HAS_FLOAT128 +#endif + +#if (BOOST_LIBSTDCXX_VERSION >= 100000) && defined(BOOST_HAS_HASH) +// +// hash_set/hash_map deprecated and have terminal bugs: +// +#undef BOOST_HAS_HASH +#undef BOOST_HAS_SET_HEADER +#undef BOOST_HAS_MAP_HEADER +#endif + #if (BOOST_LIBSTDCXX_VERSION >= 100000) && defined(BOOST_HAS_HASH) // @@ -313,10 +330,6 @@ extern "C" char *gets (char *__s); # define BOOST_NO_CXX14_STD_EXCHANGE #endif -#if defined(__clang_major__) && ((__clang_major__ < 3) || ((__clang_major__ == 3) && (__clang_minor__ < 7))) -// As of clang-3.6, libstdc++ header throws up errors with clang: -# define BOOST_NO_CXX11_HDR_ATOMIC -#endif // // C++0x features in GCC 5.1 and later // @@ -365,6 +378,35 @@ extern "C" char *gets (char *__s); # define BOOST_NO_CXX17_HDR_CHARCONV #endif +#if BOOST_LIBSTDCXX_VERSION < 110000 +// +// Header may be present but lacks std::bit_cast: +// +#define BOOST_NO_CXX20_HDR_BIT +#endif + +#ifndef __cpp_impl_coroutine +# define BOOST_NO_CXX20_HDR_COROUTINE +#endif + +// +// These next defines are mostly for older clang versions with a newer libstdc++ : +// +#if !defined(__cpp_lib_concepts) +#if !defined(BOOST_NO_CXX20_HDR_COMPARE) +# define BOOST_NO_CXX20_HDR_COMPARE +#endif +#if !defined(BOOST_NO_CXX20_HDR_CONCEPTS) +# define BOOST_NO_CXX20_HDR_CONCEPTS +#endif +#if !defined(BOOST_NO_CXX20_HDR_SPAN) +# define BOOST_NO_CXX20_HDR_SPAN +#endif +#if !defined(BOOST_NO_CXX20_HDR_RANGES) +# define BOOST_NO_CXX20_HDR_RANGES +#endif +#endif + // // Headers not present on Solaris with the Oracle compiler: #if defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5140) diff --git a/boostregex/boost/config/workaround.hpp b/boostregex/boost/config/workaround.hpp index 7c6a2e62f..688f96366 100644 --- a/boostregex/boost/config/workaround.hpp +++ b/boostregex/boost/config/workaround.hpp @@ -192,6 +192,11 @@ #else #define _COMPILER_VERSION_WORKAROUND_GUARD 0 #endif +#ifndef __clang_major__ +#define __clang_major___WORKAROUND_GUARD 1 +#else +#define __clang_major___WORKAROUND_GUARD 0 +#endif #ifndef _RWSTD_VER #define _RWSTD_VER_WORKAROUND_GUARD 1 @@ -254,6 +259,12 @@ #else #define BOOST_INTEL_WORKAROUND_GUARD 0 #endif +#ifndef BOOST_CLANG_VERSION +#define BOOST_CLANG_VERSION_WORKAROUND_GUARD 1 +#else +#define BOOST_CLANG_VERSION_WORKAROUND_GUARD 0 +#endif + // Always define to zero, if it's used it'll be defined my MPL: #define BOOST_MPL_CFG_GCC_WORKAROUND_GUARD 0 diff --git a/boostregex/boost/exception/detail/exception_ptr.hpp b/boostregex/boost/exception/detail/exception_ptr.hpp index 40c7108ba..c3b97b9c4 100644 --- a/boostregex/boost/exception/detail/exception_ptr.hpp +++ b/boostregex/boost/exception/detail/exception_ptr.hpp @@ -40,6 +40,37 @@ namespace boost { + namespace + exception_detail + { +#ifndef BOOST_NO_CXX11_HDR_EXCEPTION + struct + std_exception_ptr_wrapper: + std::exception + { + std::exception_ptr p; + explicit std_exception_ptr_wrapper( std::exception_ptr const & ptr ) BOOST_NOEXCEPT: + p(ptr) + { + } +#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES + explicit std_exception_ptr_wrapper( std::exception_ptr && ptr ) BOOST_NOEXCEPT: + p(static_cast(ptr)) + { + } +#endif + }; + shared_ptr + inline + wrap_exception_ptr( std::exception_ptr const & e ) + { + exception_detail::clone_base const & base = + boost::enable_current_exception(std_exception_ptr_wrapper(std::current_exception())); + return shared_ptr(base.clone()); + } +#endif + } + class exception_ptr; namespace exception_detail { void rethrow_exception_( exception_ptr const & ); } @@ -54,6 +85,12 @@ boost exception_ptr() { } +#ifndef BOOST_NO_CXX11_HDR_EXCEPTION + exception_ptr( std::exception_ptr const & e ): + ptr_(exception_detail::wrap_exception_ptr(e)) + { + } +#endif explicit exception_ptr( impl const & ptr ): ptr_(ptr) @@ -307,24 +344,6 @@ boost return boost::copy_exception(unknown_exception(e)); } -#ifndef BOOST_NO_CXX11_HDR_EXCEPTION - struct - std_exception_ptr_wrapper - { - std::exception_ptr p; - explicit std_exception_ptr_wrapper( std::exception_ptr const & ptr ) BOOST_NOEXCEPT: - p(ptr) - { - } -#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES - explicit std_exception_ptr_wrapper( std::exception_ptr && ptr ) BOOST_NOEXCEPT: - p(static_cast(ptr)) - { - } -#endif - }; -#endif - inline exception_ptr current_exception_impl() @@ -457,10 +476,7 @@ boost #ifndef BOOST_NO_CXX11_HDR_EXCEPTION try { - // wrap the std::exception_ptr in a clone-enabled Boost.Exception object - exception_detail::clone_base const & base = - boost::enable_current_exception(std_exception_ptr_wrapper(std::current_exception())); - return exception_ptr(shared_ptr(base.clone())); + return exception_ptr(std::current_exception()); } catch( ...) diff --git a/boostregex/boost/exception/exception.hpp b/boostregex/boost/exception/exception.hpp index 37a582c2e..4c768eef8 100644 --- a/boostregex/boost/exception/exception.hpp +++ b/boostregex/boost/exception/exception.hpp @@ -7,6 +7,7 @@ #define BOOST_EXCEPTION_274DA366004E11DCB1DDFE2E56D89593 #include +#include #ifdef BOOST_EXCEPTION_MINI_BOOST #include @@ -390,6 +391,9 @@ boost } //////////////////////////////////////////////////////////////////////// +#if defined(BOOST_NO_EXCEPTIONS) + BOOST_NORETURN void throw_exception(std::exception const & e); // user defined +#endif namespace exception_detail @@ -466,7 +470,11 @@ boost void rethrow() const { +#if defined(BOOST_NO_EXCEPTIONS) + boost::throw_exception(*this); +#else throw*this; +#endif } }; } diff --git a/boostregex/boost/exception/info.hpp b/boostregex/boost/exception/info.hpp index 86d558bc8..3fd6681f5 100644 --- a/boostregex/boost/exception/info.hpp +++ b/boostregex/boost/exception/info.hpp @@ -31,7 +31,7 @@ boost template inline std::string - error_info_name( error_info const & x ) + error_info_name( error_info const & ) { return tag_type_name(); } diff --git a/boostregex/boost/regex/concepts.hpp b/boostregex/boost/regex/concepts.hpp index fe14f4006..2eafac1b5 100644 --- a/boostregex/boost/regex/concepts.hpp +++ b/boostregex/boost/regex/concepts.hpp @@ -29,7 +29,7 @@ #endif #include #include -#include +#include #ifdef BOOST_REGEX_CXX03 #define RW_NS boost diff --git a/boostregex/boost/regex/v5/basic_regex_creator.hpp b/boostregex/boost/regex/v5/basic_regex_creator.hpp index ddd2f2573..82306d36c 100644 --- a/boostregex/boost/regex/v5/basic_regex_creator.hpp +++ b/boostregex/boost/regex/v5/basic_regex_creator.hpp @@ -20,8 +20,6 @@ #ifndef BOOST_REGEX_V5_BASIC_REGEX_CREATOR_HPP #define BOOST_REGEX_V5_BASIC_REGEX_CREATOR_HPP -#include - #ifdef BOOST_REGEX_MSVC # pragma warning(push) #pragma warning(disable:4459) @@ -30,6 +28,8 @@ #endif #endif +#include + namespace boost{ namespace BOOST_REGEX_DETAIL_NS{ @@ -232,7 +232,6 @@ protected: bool m_icase; // true for case insensitive matches unsigned m_repeater_id; // the state_id of the next repeater bool m_has_backrefs; // true if there are actually any backrefs - indexed_bit_flag m_backrefs; // bitmask of permitted backrefs std::uintmax_t m_bad_repeats; // bitmask of repeats we can't deduce a startmap for; bool m_has_recursions; // set when we have recursive expressions to fixup std::vector m_recursion_checks; // notes which recursions we've followed while analysing this expression diff --git a/boostregex/boost/regex/v5/basic_regex_parser.hpp b/boostregex/boost/regex/v5/basic_regex_parser.hpp index 858eb8055..34d775ef8 100644 --- a/boostregex/boost/regex/v5/basic_regex_parser.hpp +++ b/boostregex/boost/regex/v5/basic_regex_parser.hpp @@ -98,6 +98,7 @@ private: std::ptrdiff_t m_alt_insert_point; // where to insert the next alternative bool m_has_case_change; // true if somewhere in the current block the case has changed unsigned m_recursion_count; // How many times we've called parse_all. + unsigned m_max_backref; // Largest index of any backref. #if defined(BOOST_REGEX_MSVC) && defined(_M_IX86) // This is an ugly warning suppression workaround (for warnings *inside* std::vector // that can not otherwise be suppressed)... @@ -114,7 +115,7 @@ private: template basic_regex_parser::basic_regex_parser(regex_data* data) : basic_regex_creator(data), m_parser_proc(), m_base(0), m_end(0), m_position(0), - m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0) + m_mark_count(0), m_mark_reset(-1), m_max_mark(0), m_paren_start(0), m_alt_insert_point(0), m_has_case_change(false), m_recursion_count(0), m_max_backref(0) { } @@ -184,6 +185,13 @@ void basic_regex_parser::parse(const charT* p1, const charT* p2, return; // fill in our sub-expression count: this->m_pdata->m_mark_count = 1u + (std::size_t)m_mark_count; + // + // Check we don't have backreferences to sub-expressions which don't exist: + // + if (m_max_backref > m_mark_count) + { + fail(regex_constants::error_backref, std::distance(m_base, m_position), "Found a backreference to a non-existant sub-expression."); + } this->finalize(p1, p2); } @@ -529,11 +537,6 @@ bool basic_regex_parser::parse_open_paren() // restore the alternate insertion point: // this->m_alt_insert_point = last_alt_point; - // - // allow backrefs to this mark: - // - if(markid > 0) - this->m_backrefs.set(markid); return true; } @@ -899,12 +902,14 @@ escape_type_class_jump: } if(negative) i = 1 + (static_cast(m_mark_count) - i); - if(((i < hash_value_mask) && (i > 0) && (this->m_backrefs.test((std::size_t)i))) || ((i >= hash_value_mask) && (this->m_pdata->get_id((int)i) > 0) && (this->m_backrefs.test(this->m_pdata->get_id((int)i))))) + if(((i < hash_value_mask) && (i > 0)) || ((i >= hash_value_mask) && (this->m_pdata->get_id((int)i) > 0))) { m_position = pc; re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace))); pb->index = (int)i; pb->icase = this->flags() & regbase::icase; + if ((i > m_max_backref) && (i < hash_value_mask)) + m_max_backref = i; } else { @@ -1029,6 +1034,7 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ case syntax_element_jump: case syntax_element_startmark: case syntax_element_backstep: + case syntax_element_toggle_case: // can't legally repeat any of the above: fail(regex_constants::error_badrepeat, m_position - m_base); return false; @@ -1098,6 +1104,9 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ } else contin = false; + break; + default: + contin = false; } } else @@ -1931,12 +1940,14 @@ bool basic_regex_parser::parse_backref() charT c = unescape_character(); this->append_literal(c); } - else if((i > 0) && (this->m_backrefs.test((std::size_t)i))) + else if((i > 0)) { m_position = pc; re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace))); pb->index = (int)i; pb->icase = this->flags() & regbase::icase; + if(i > m_max_backref) + m_max_backref = i; } else { @@ -2692,10 +2703,6 @@ option_group_jump: { if(this->flags() & regbase::save_subexpression_location) this->m_pdata->m_subs.at((std::size_t)markid - 1).second = std::distance(m_base, m_position) - 1; - // - // allow backrefs to this mark: - // - this->m_backrefs.set(markid); } return true; } @@ -3101,7 +3108,13 @@ bool basic_regex_parser::unwind_alts(std::ptrdiff_t last_paren_st m_alt_jumps.pop_back(); this->m_pdata->m_data.align(); re_jump* jmp = static_cast(this->getaddress(jump_offset)); - BOOST_REGEX_ASSERT(jmp->type == syntax_element_jump); + if (jmp->type != syntax_element_jump) + { + // Something really bad happened, this used to be an assert, + // but we'll make it an error just in case we should ever get here. + fail(regex_constants::error_unknown, this->m_position - this->m_base, "Internal logic failed while compiling the expression, probably you added a repeat to something non-repeatable!"); + return false; + } jmp->alt.i = this->m_pdata->m_data.size() - jump_offset; } return true; diff --git a/boostregex/boost/regex/v5/icu.hpp b/boostregex/boost/regex/v5/icu.hpp index a92649657..f172553dc 100644 --- a/boostregex/boost/regex/v5/icu.hpp +++ b/boostregex/boost/regex/v5/icu.hpp @@ -161,7 +161,7 @@ public: } char_type translate_nocase(char_type c) const { - return ::u_tolower(c); + return ::u_foldCase(c, U_FOLD_CASE_DEFAULT); } char_type translate(char_type c, bool icase) const { diff --git a/boostregex/boost/regex/v5/indexed_bit_flag.hpp b/boostregex/boost/regex/v5/indexed_bit_flag.hpp deleted file mode 100644 index b61e5cad0..000000000 --- a/boostregex/boost/regex/v5/indexed_bit_flag.hpp +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * Copyright (c) 2020 - * John Maddock - * - * Use, modification and distribution are subject to the - * Boost Software License, Version 1.0. (See accompanying file - * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - * - */ - - /* - * LOCATION: see http://www.boost.org for most recent version. - * FILE basic_regex_parser.cpp - * VERSION see - * DESCRIPTION: Declares template class basic_regex_parser. - */ - -#include -#include - -#ifndef BOOST_REGEX_V5_INDEXED_BIT_FLAG_HPP -#define BOOST_REGEX_V5_INDEXED_BIT_FLAG_HPP - -namespace boost{ -namespace BOOST_REGEX_DETAIL_NS{ - -class indexed_bit_flag -{ - std::uint64_t low_mask; - std::set mask_set; -public: - indexed_bit_flag() : low_mask(0) {} - void set(std::size_t i) - { - if (i < std::numeric_limits::digits - 1) - low_mask |= static_cast(1u) << i; - else - mask_set.insert(i); - } - bool test(std::size_t i) - { - if (i < std::numeric_limits::digits - 1) - return low_mask & static_cast(1u) << i ? true : false; - else - return mask_set.find(i) != mask_set.end(); - } -}; - -} // namespace BOOST_REGEX_DETAIL_NS -} // namespace boost - - -#endif diff --git a/boostregex/boost/regex/v5/mem_block_cache.hpp b/boostregex/boost/regex/v5/mem_block_cache.hpp index 0af4eae18..eb3ec776c 100644 --- a/boostregex/boost/regex/v5/mem_block_cache.hpp +++ b/boostregex/boost/regex/v5/mem_block_cache.hpp @@ -85,10 +85,10 @@ struct mem_block_node struct mem_block_cache { // this member has to be statically initialsed: - mem_block_node* next; - unsigned cached_blocks; + mem_block_node* next { nullptr }; + unsigned cached_blocks { 0 }; #ifdef BOOST_HAS_THREADS - boost::static_mutex mut; + std::mutex mut; #endif ~mem_block_cache() @@ -133,11 +133,7 @@ struct mem_block_cache } static mem_block_cache& instance() { -#ifdef BOOST_HAS_THREADS - static mem_block_cache block_cache = { 0, 0, BOOST_STATIC_MUTEX_INIT, }; -#else - static mem_block_cache block_cache = { 0, 0, }; -#endif + static mem_block_cache block_cache; return block_cache; } }; diff --git a/boostregex/boost/regex/v5/pattern_except.hpp b/boostregex/boost/regex/v5/pattern_except.hpp index 731aefb6f..3fbdca0a2 100644 --- a/boostregex/boost/regex/v5/pattern_except.hpp +++ b/boostregex/boost/regex/v5/pattern_except.hpp @@ -77,7 +77,8 @@ typedef regex_error bad_expression; namespace BOOST_REGEX_DETAIL_NS{ -inline void raise_runtime_error(const std::runtime_error& ex) +template +inline void raise_runtime_error(const E& ex) { #ifndef BOOST_REGEX_STANDALONE ::boost::throw_exception(ex); @@ -90,7 +91,7 @@ template void raise_error(const traits& t, regex_constants::error_type code) { (void)t; // warning suppression - std::runtime_error e(t.error_string(code)); + regex_error e(t.error_string(code), code, 0); ::boost::BOOST_REGEX_DETAIL_NS::raise_runtime_error(e); } diff --git a/boostregex/boost/regex/v5/perl_matcher_common.hpp b/boostregex/boost/regex/v5/perl_matcher_common.hpp index 5b29d8937..dcce9e6ac 100644 --- a/boostregex/boost/regex/v5/perl_matcher_common.hpp +++ b/boostregex/boost/regex/v5/perl_matcher_common.hpp @@ -471,6 +471,11 @@ bool perl_matcher::match_word_boundary() template bool perl_matcher::match_within_word() { + bool b = !match_word_boundary(); + if(b) + pstate = pstate->next.p; + return b; + /* if(position == last) return false; // both prev and this character must be m_word_mask: @@ -492,6 +497,7 @@ bool perl_matcher::match_within_word() } } return false; + */ } template diff --git a/boostregex/boost/regex/v5/perl_matcher_non_recursive.hpp b/boostregex/boost/regex/v5/perl_matcher_non_recursive.hpp index 1d2f0a53a..28d6c462f 100644 --- a/boostregex/boost/regex/v5/perl_matcher_non_recursive.hpp +++ b/boostregex/boost/regex/v5/perl_matcher_non_recursive.hpp @@ -417,7 +417,8 @@ bool perl_matcher::match_startmark() { // Must be unwinding from a COMMIT/SKIP/PRUNE and the independent // sub failed, need to unwind everything else: - while(unwind(false)); + while (m_backup_state->state_id) + unwind(false); return false; } #if !defined(BOOST_NO_EXCEPTIONS) @@ -1353,6 +1354,7 @@ bool perl_matcher::unwind_repeater_counter(bool template bool perl_matcher::unwind_extra_block(bool) { + ++used_block_count; saved_extra_block* pmp = static_cast(m_backup_state); void* condemmed = m_stack_base; m_stack_base = pmp->base; diff --git a/boostregex/boost/regex/v5/unicode_iterator.hpp b/boostregex/boost/regex/v5/unicode_iterator.hpp index 074436096..9d3dd8b96 100644 --- a/boostregex/boost/regex/v5/unicode_iterator.hpp +++ b/boostregex/boost/regex/v5/unicode_iterator.hpp @@ -67,8 +67,6 @@ Accepts UTF-32 code points and forwards them on as UTF-16 code points. #include #include // CHAR_BIT -#include - #ifndef BOOST_REGEX_STANDALONE #include #endif diff --git a/boostregex/boost/regex/v5/w32_regex_traits.hpp b/boostregex/boost/regex/v5/w32_regex_traits.hpp index 7e90e4bad..16f7ee4ea 100644 --- a/boostregex/boost/regex/v5/w32_regex_traits.hpp +++ b/boostregex/boost/regex/v5/w32_regex_traits.hpp @@ -29,10 +29,6 @@ #include #include -#define VC_EXTRALEAN -#define WIN32_LEAN_AND_MEAN -#include - #if defined(_MSC_VER) && !defined(_WIN32_WCE) && !defined(UNDER_CE) #pragma comment(lib, "user32.lib") #endif @@ -45,6 +41,31 @@ #endif #endif +#ifndef BASETYPES +// +// windows.h not included, so lets forward declare what we need: +// +#ifndef NO_STRICT +#ifndef STRICT +#define STRICT 1 +#endif +#endif + +#if defined(STRICT) +#define BOOST_RE_DETAIL_DECLARE_HANDLE(x) struct x##__; typedef struct x##__ *x +#else +#define BOOST_RE_DETAIL_DECLARE_HANDLE(x) typedef void* x +#endif +// +// This must be in the global namespace: +// +extern "C" { + + BOOST_RE_DETAIL_DECLARE_HANDLE(HINSTANCE); + typedef HINSTANCE HMODULE; +} +#endif + namespace boost{ // @@ -58,7 +79,7 @@ namespace BOOST_REGEX_DETAIL_NS{ // // start by typedeffing the types we'll need: // -typedef std::uint32_t lcid_type; // placeholder for LCID. +typedef unsigned long lcid_type; // placeholder for LCID. typedef std::shared_ptr cat_type; // placeholder for dll HANDLE. // @@ -93,6 +114,125 @@ wchar_t w32_toupper(wchar_t c, lcid_type); bool w32_is(lcid_type, std::uint32_t mask, char c); #ifndef BOOST_NO_WREGEX bool w32_is(lcid_type, std::uint32_t mask, wchar_t c); +#endif + +#ifndef BASETYPES +// +// Forward declarations of the small number of windows types and API's we use: +// + +#if !defined(__LP64__) +using dword = unsigned long; +#else +using DWORD = unsigned int; +#endif +using word = unsigned short; +using lctype = dword; + +static constexpr dword ct_ctype1 = 0x00000001; +static constexpr dword c1_upper = 0x0001; // upper case +static constexpr dword c1_lower = 0x0002; // lower case +static constexpr dword c1_digit = 0x0004; // decimal digits +static constexpr dword c1_space = 0x0008; // spacing characters +static constexpr dword c1_punct = 0x0010; // punctuation characters +static constexpr dword c1_cntrl = 0x0020; // control characters +static constexpr dword c1_blank = 0x0040; // blank characters +static constexpr dword c1_xdigit = 0x0080; // other digits +static constexpr dword c1_alpha = 0x0100; // any linguistic character +static constexpr dword c1_defined = 0x0200; // defined character +static constexpr unsigned int cp_acp = 0; +static constexpr dword lcmap_lowercase = 0x00000100; +static constexpr dword lcmap_uppercase = 0x00000200; +static constexpr dword lcmap_sortkey = 0x00000400; // WC sort key (normalize) +static constexpr lctype locale_idefaultansicodepage = 0x00001004; + +# ifdef UNDER_CE +# ifndef WINAPI +# ifndef _WIN32_WCE_EMULATION +# define BOOST_RE_STDCALL __cdecl // Note this doesn't match the desktop definition +# else +# define BOOST_RE_STDCALL __stdcall +# endif +# endif +# else +# if defined(_M_IX86) || defined(__i386__) +# define BOOST_RE_STDCALL __stdcall +# else + // On architectures other than 32-bit x86 __stdcall is ignored. Clang also issues a warning. +# define BOOST_RE_STDCALL +# endif +# endif + +#if defined (WIN32_PLATFORM_PSPC) +#define BOOST_RE_IMPORT __declspec( dllimport ) +#elif defined (_WIN32_WCE) +#define BOOST_RE_IMPORT +#else +#define BOOST_RE_IMPORT __declspec( dllimport ) +#endif + +extern "C" { + + BOOST_RE_IMPORT int BOOST_RE_STDCALL FreeLibrary(HMODULE hLibModule); + BOOST_RE_IMPORT int BOOST_RE_STDCALL LCMapStringA(lcid_type Locale, dword dwMapFlags, const char* lpSrcStr, int cchSrc, char* lpDestStr, int cchDest); + BOOST_RE_IMPORT int BOOST_RE_STDCALL LCMapStringW(lcid_type Locale, dword dwMapFlags, const wchar_t* lpSrcStr, int cchSrc, wchar_t* lpDestStr, int cchDest); + BOOST_RE_IMPORT int BOOST_RE_STDCALL MultiByteToWideChar(unsigned int CodePage, dword dwFlags, const char* lpMultiByteStr, int cbMultiByte, wchar_t* lpWideCharStr, int cchWideChar); + BOOST_RE_IMPORT int BOOST_RE_STDCALL LCMapStringW(lcid_type Locale, dword dwMapFlags, const wchar_t* lpSrcStr, int cchSrc, wchar_t* lpDestStr, int cchDest); + BOOST_RE_IMPORT int BOOST_RE_STDCALL WideCharToMultiByte(unsigned int CodePage, dword dwFlags, const wchar_t* lpWideCharStr, int cchWideChar, char* lpMultiByteStr, int cbMultiByte, const char* lpDefaultChar, int* lpUsedDefaultChar); + BOOST_RE_IMPORT int BOOST_RE_STDCALL GetStringTypeExA(lcid_type Locale, dword dwInfoType, const char* lpSrcStr, int cchSrc, word* lpCharType); + BOOST_RE_IMPORT int BOOST_RE_STDCALL GetStringTypeExW(lcid_type Locale, dword dwInfoType, const wchar_t* lpSrcStr, int cchSrc, word* lpCharType); + BOOST_RE_IMPORT lcid_type BOOST_RE_STDCALL GetUserDefaultLCID(); + BOOST_RE_IMPORT int BOOST_RE_STDCALL GetStringTypeExA(lcid_type Locale, dword dwInfoType, const char* lpSrcStr, int cchSrc, word* lpCharType); + BOOST_RE_IMPORT int BOOST_RE_STDCALL GetStringTypeExW(lcid_type Locale, dword dwInfoType, const wchar_t* lpSrcStr, int cchSrc, word* lpCharType); + BOOST_RE_IMPORT HMODULE BOOST_RE_STDCALL LoadLibraryA(const char* lpLibFileName); + BOOST_RE_IMPORT HMODULE BOOST_RE_STDCALL LoadLibraryW(const wchar_t* lpLibFileName); + BOOST_RE_IMPORT int BOOST_RE_STDCALL LoadStringW(HINSTANCE hInstance, unsigned int uID, wchar_t* lpBuffer, int cchBufferMax); + BOOST_RE_IMPORT int BOOST_RE_STDCALL LoadStringA(HINSTANCE hInstance, unsigned int uID, char* lpBuffer, int cchBufferMax); + BOOST_RE_IMPORT int BOOST_RE_STDCALL GetLocaleInfoW(lcid_type Locale, lctype LCType, wchar_t* lpLCData, int cchData); +} + +#else +// +// We have windows.h already included: +// +using dword = DWORD; +using word = WORD; +using lctype = LCTYPE; + +static constexpr dword ct_ctype1 = 0x00000001; +static constexpr dword c1_upper = 0x0001; // upper case +static constexpr dword c1_lower = 0x0002; // lower case +static constexpr dword c1_digit = 0x0004; // decimal digits +static constexpr dword c1_space = 0x0008; // spacing characters +static constexpr dword c1_punct = 0x0010; // punctuation characters +static constexpr dword c1_cntrl = 0x0020; // control characters +static constexpr dword c1_blank = 0x0040; // blank characters +static constexpr dword c1_xdigit = 0x0080; // other digits +static constexpr dword c1_alpha = 0x0100; // any linguistic character +static constexpr dword c1_defined = 0x0200; // defined character +static constexpr unsigned int cp_acp = 0; +static constexpr dword lcmap_lowercase = 0x00000100; +static constexpr dword lcmap_uppercase = 0x00000200; +static constexpr dword lcmap_sortkey = 0x00000400; // WC sort key (normalize) +static constexpr lctype locale_idefaultansicodepage = 0x00001004; + +using ::FreeLibrary; +using ::LCMapStringA; +using ::LCMapStringW; +using ::MultiByteToWideChar; +using ::LCMapStringW; +using ::WideCharToMultiByte; +using ::GetStringTypeExA; +using ::GetStringTypeExW; +using ::GetUserDefaultLCID; +using ::GetStringTypeExA; +using ::GetStringTypeExW; +using ::LoadLibraryA; +using ::LoadLibraryW; +using ::LoadStringW; +using ::LoadStringA; +using ::GetLocaleInfoW; + #endif // // class w32_regex_traits_base: @@ -675,13 +815,13 @@ std::mutex& w32_regex_traits::get_mutex_inst() namespace BOOST_REGEX_DETAIL_NS { #ifdef BOOST_NO_ANSI_APIS - inline UINT get_code_page_for_locale_id(lcid_type idx) + inline unsigned int get_code_page_for_locale_id(lcid_type idx) { - WCHAR code_page_string[7]; - if (::GetLocaleInfoW(idx, LOCALE_IDEFAULTANSICODEPAGE, code_page_string, 7) == 0) + wchar_t code_page_string[7]; + if (boost::BOOST_REGEX_DETAIL_NS::GetLocaleInfoW(idx, locale_idefaultansicodepage, code_page_string, 7) == 0) return 0; - return static_cast(_wtol(code_page_string)); + return static_cast(_wtol(code_page_string)); } #endif @@ -751,21 +891,21 @@ namespace BOOST_REGEX_DETAIL_NS { for (int ii = 0; ii < (1 << CHAR_BIT); ++ii) char_map[ii] = static_cast(ii); #ifndef BOOST_NO_ANSI_APIS - int r = ::LCMapStringA(this->m_locale, LCMAP_LOWERCASE, char_map, 1 << CHAR_BIT, this->m_lower_map, 1 << CHAR_BIT); + int r = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA(this->m_locale, lcmap_lowercase, char_map, 1 << CHAR_BIT, this->m_lower_map, 1 << CHAR_BIT); BOOST_REGEX_ASSERT(r != 0); #else - UINT code_page = get_code_page_for_locale_id(this->m_locale); + unsigned int code_page = get_code_page_for_locale_id(this->m_locale); BOOST_REGEX_ASSERT(code_page != 0); - WCHAR wide_char_map[1 << CHAR_BIT]; - int conv_r = ::MultiByteToWideChar(code_page, 0, char_map, 1 << CHAR_BIT, wide_char_map, 1 << CHAR_BIT); + wchar_t wide_char_map[1 << CHAR_BIT]; + int conv_r = boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, char_map, 1 << CHAR_BIT, wide_char_map, 1 << CHAR_BIT); BOOST_REGEX_ASSERT(conv_r != 0); - WCHAR wide_lower_map[1 << CHAR_BIT]; - int r = ::LCMapStringW(this->m_locale, LCMAP_LOWERCASE, wide_char_map, 1 << CHAR_BIT, wide_lower_map, 1 << CHAR_BIT); + wchar_t wide_lower_map[1 << CHAR_BIT]; + int r = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW(this->m_locale, lcmap_lowercase, wide_char_map, 1 << CHAR_BIT, wide_lower_map, 1 << CHAR_BIT); BOOST_REGEX_ASSERT(r != 0); - conv_r = ::WideCharToMultiByte(code_page, 0, wide_lower_map, r, this->m_lower_map, 1 << CHAR_BIT, NULL, NULL); + conv_r = boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(code_page, 0, wide_lower_map, r, this->m_lower_map, 1 << CHAR_BIT, NULL, NULL); BOOST_REGEX_ASSERT(conv_r != 0); #endif if (r < (1 << CHAR_BIT)) @@ -777,36 +917,36 @@ namespace BOOST_REGEX_DETAIL_NS { } #ifndef BOOST_NO_ANSI_APIS - r = ::GetStringTypeExA(this->m_locale, CT_CTYPE1, char_map, 1 << CHAR_BIT, this->m_type_map); + r = boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExA(this->m_locale, ct_ctype1, char_map, 1 << CHAR_BIT, this->m_type_map); #else - r = ::GetStringTypeExW(this->m_locale, CT_CTYPE1, wide_char_map, 1 << CHAR_BIT, this->m_type_map); + r = boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(this->m_locale, ct_ctype1, wide_char_map, 1 << CHAR_BIT, this->m_type_map); #endif BOOST_REGEX_ASSERT(0 != r); } inline lcid_type w32_get_default_locale() { - return ::GetUserDefaultLCID(); + return boost::BOOST_REGEX_DETAIL_NS::GetUserDefaultLCID(); } inline bool w32_is_lower(char c, lcid_type idx) { #ifndef BOOST_NO_ANSI_APIS - WORD mask; - if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER)) + word mask; + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExA(idx, ct_ctype1, &c, 1, &mask) && (mask & c1_lower)) return true; return false; #else - UINT code_page = get_code_page_for_locale_id(idx); + unsigned int code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return false; - WCHAR wide_c; - if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) + wchar_t wide_c; + if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) return false; - WORD mask; - if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_LOWER)) + word mask; + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &wide_c, 1, &mask) && (mask & c1_lower)) return true; return false; #endif @@ -814,8 +954,8 @@ namespace BOOST_REGEX_DETAIL_NS { inline bool w32_is_lower(wchar_t c, lcid_type idx) { - WORD mask; - if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_LOWER)) + word mask; + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &c, 1, &mask) && (mask & c1_lower)) return true; return false; } @@ -823,21 +963,21 @@ namespace BOOST_REGEX_DETAIL_NS { inline bool w32_is_upper(char c, lcid_type idx) { #ifndef BOOST_NO_ANSI_APIS - WORD mask; - if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER)) + word mask; + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExA(idx, ct_ctype1, &c, 1, &mask) && (mask & c1_upper)) return true; return false; #else - UINT code_page = get_code_page_for_locale_id(idx); + unsigned int code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return false; - WCHAR wide_c; - if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) + wchar_t wide_c; + if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) return false; - WORD mask; - if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER)) + word mask; + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &wide_c, 1, &mask) && (mask & c1_upper)) return true; return false; #endif @@ -845,28 +985,28 @@ namespace BOOST_REGEX_DETAIL_NS { inline bool w32_is_upper(wchar_t c, lcid_type idx) { - WORD mask; - if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & C1_UPPER)) + word mask; + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &c, 1, &mask) && (mask & c1_upper)) return true; return false; } inline void free_module(void* mod) { - ::FreeLibrary(static_cast(mod)); + boost::BOOST_REGEX_DETAIL_NS::FreeLibrary(static_cast(mod)); } inline cat_type w32_cat_open(const std::string& name) { #ifndef BOOST_NO_ANSI_APIS - cat_type result(::LoadLibraryA(name.c_str()), &free_module); + cat_type result(boost::BOOST_REGEX_DETAIL_NS::LoadLibraryA(name.c_str()), &free_module); return result; #else - LPWSTR wide_name = (LPWSTR)_alloca((name.size() + 1) * sizeof(WCHAR)); - if (::MultiByteToWideChar(CP_ACP, 0, name.c_str(), name.size(), wide_name, name.size() + 1) == 0) + wchar_t* wide_name = (wchar_t*)_alloca((name.size() + 1) * sizeof(wchar_t)); + if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(cp_acp, 0, name.c_str(), (int)name.size(), wide_name, (int)(name.size() + 1)) == 0) return cat_type(); - cat_type result(::LoadLibraryW(wide_name), &free_module); + cat_type result(boost::BOOST_REGEX_DETAIL_NS::LoadLibraryW(wide_name), &free_module); return result; #endif } @@ -875,7 +1015,7 @@ namespace BOOST_REGEX_DETAIL_NS { { #ifndef BOOST_NO_ANSI_APIS char buf[256]; - if (0 == ::LoadStringA( + if (0 == boost::BOOST_REGEX_DETAIL_NS::LoadStringA( static_cast(cat.get()), i, buf, @@ -885,8 +1025,8 @@ namespace BOOST_REGEX_DETAIL_NS { return def; } #else - WCHAR wbuf[256]; - int r = ::LoadStringW( + wchar_t wbuf[256]; + int r = boost::BOOST_REGEX_DETAIL_NS::LoadStringW( static_cast(cat.get()), i, wbuf, @@ -896,9 +1036,9 @@ namespace BOOST_REGEX_DETAIL_NS { return def; - int buf_size = 1 + ::WideCharToMultiByte(CP_ACP, 0, wbuf, r, NULL, 0, NULL, NULL); - LPSTR buf = (LPSTR)_alloca(buf_size); - if (::WideCharToMultiByte(CP_ACP, 0, wbuf, r, buf, buf_size, NULL, NULL) == 0) + int buf_size = 1 + boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(cp_acp, 0, wbuf, r, NULL, 0, NULL, NULL); + char* buf = (char*)_alloca(buf_size); + if (boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(cp_acp, 0, wbuf, r, buf, buf_size, NULL, NULL) == 0) return def; // failed conversion. #endif return std::string(buf); @@ -908,12 +1048,7 @@ namespace BOOST_REGEX_DETAIL_NS { inline std::wstring w32_cat_get(const cat_type& cat, lcid_type, int i, const std::wstring& def) { wchar_t buf[256]; - if (0 == ::LoadStringW( - static_cast(cat.get()), - i, - buf, - 256 - )) + if (0 == boost::BOOST_REGEX_DETAIL_NS::LoadStringW(static_cast(cat.get()), i, buf, 256)) { return def; } @@ -923,9 +1058,9 @@ namespace BOOST_REGEX_DETAIL_NS { inline std::string w32_transform(lcid_type idx, const char* p1, const char* p2) { #ifndef BOOST_NO_ANSI_APIS - int bytes = ::LCMapStringA( + int bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA( idx, // locale identifier - LCMAP_SORTKEY, // mapping transformation type + lcmap_sortkey, // mapping transformation type p1, // source string static_cast(p2 - p1), // number of characters in source string 0, // destination buffer @@ -934,27 +1069,27 @@ namespace BOOST_REGEX_DETAIL_NS { if (!bytes) return std::string(p1, p2); std::string result(++bytes, '\0'); - bytes = ::LCMapStringA( + bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA( idx, // locale identifier - LCMAP_SORTKEY, // mapping transformation type + lcmap_sortkey, // mapping transformation type p1, // source string static_cast(p2 - p1), // number of characters in source string &*result.begin(), // destination buffer bytes // size of destination buffer ); #else - UINT code_page = get_code_page_for_locale_id(idx); + unsigned int code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return std::string(p1, p2); int src_len = static_cast(p2 - p1); - LPWSTR wide_p1 = (LPWSTR)_alloca((src_len + 1) * 2); - if (::MultiByteToWideChar(code_page, 0, p1, src_len, wide_p1, src_len + 1) == 0) + wchar_t* wide_p1 = (wchar_t*)_alloca((src_len + 1) * 2); + if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, p1, src_len, wide_p1, src_len + 1) == 0) return std::string(p1, p2); - int bytes = ::LCMapStringW( + int bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW( idx, // locale identifier - LCMAP_SORTKEY, // mapping transformation type + lcmap_sortkey, // mapping transformation type wide_p1, // source string src_len, // number of characters in source string 0, // destination buffer @@ -963,12 +1098,12 @@ namespace BOOST_REGEX_DETAIL_NS { if (!bytes) return std::string(p1, p2); std::string result(++bytes, '\0'); - bytes = ::LCMapStringW( + bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW( idx, // locale identifier - LCMAP_SORTKEY, // mapping transformation type + lcmap_sortkey, // mapping transformation type wide_p1, // source string src_len, // number of characters in source string - (LPWSTR) & *result.begin(), // destination buffer + (wchar_t*) & *result.begin(), // destination buffer bytes // size of destination buffer ); #endif @@ -984,9 +1119,9 @@ namespace BOOST_REGEX_DETAIL_NS { #ifndef BOOST_NO_WREGEX inline std::wstring w32_transform(lcid_type idx, const wchar_t* p1, const wchar_t* p2) { - int bytes = ::LCMapStringW( + int bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW( idx, // locale identifier - LCMAP_SORTKEY, // mapping transformation type + lcmap_sortkey, // mapping transformation type p1, // source string static_cast(p2 - p1), // number of characters in source string 0, // destination buffer @@ -995,9 +1130,9 @@ namespace BOOST_REGEX_DETAIL_NS { if (!bytes) return std::wstring(p1, p2); std::string result(++bytes, '\0'); - bytes = ::LCMapStringW( + bytes = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW( idx, // locale identifier - LCMAP_SORTKEY, // mapping transformation type + lcmap_sortkey, // mapping transformation type p1, // source string static_cast(p2 - p1), // number of characters in source string reinterpret_cast(&*result.begin()), // destination buffer *of bytes* @@ -1019,9 +1154,9 @@ namespace BOOST_REGEX_DETAIL_NS { { char result[2]; #ifndef BOOST_NO_ANSI_APIS - int b = ::LCMapStringA( + int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA( idx, // locale identifier - LCMAP_LOWERCASE, // mapping transformation type + lcmap_lowercase, // mapping transformation type &c, // source string 1, // number of characters in source string result, // destination buffer @@ -1029,18 +1164,18 @@ namespace BOOST_REGEX_DETAIL_NS { if (b == 0) return c; #else - UINT code_page = get_code_page_for_locale_id(idx); + unsigned int code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return c; - WCHAR wide_c; - if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) + wchar_t wide_c; + if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) return c; - WCHAR wide_result; - int b = ::LCMapStringW( + wchar_t wide_result; + int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW( idx, // locale identifier - LCMAP_LOWERCASE, // mapping transformation type + lcmap_lowercase, // mapping transformation type &wide_c, // source string 1, // number of characters in source string &wide_result, // destination buffer @@ -1048,7 +1183,7 @@ namespace BOOST_REGEX_DETAIL_NS { if (b == 0) return c; - if (::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0) + if (boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0) return c; // No single byte lower case equivalent available #endif return result[0]; @@ -1058,9 +1193,9 @@ namespace BOOST_REGEX_DETAIL_NS { inline wchar_t w32_tolower(wchar_t c, lcid_type idx) { wchar_t result[2]; - int b = ::LCMapStringW( + int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW( idx, // locale identifier - LCMAP_LOWERCASE, // mapping transformation type + lcmap_lowercase, // mapping transformation type &c, // source string 1, // number of characters in source string result, // destination buffer @@ -1074,9 +1209,9 @@ namespace BOOST_REGEX_DETAIL_NS { { char result[2]; #ifndef BOOST_NO_ANSI_APIS - int b = ::LCMapStringA( + int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringA( idx, // locale identifier - LCMAP_UPPERCASE, // mapping transformation type + lcmap_uppercase, // mapping transformation type &c, // source string 1, // number of characters in source string result, // destination buffer @@ -1084,18 +1219,18 @@ namespace BOOST_REGEX_DETAIL_NS { if (b == 0) return c; #else - UINT code_page = get_code_page_for_locale_id(idx); + unsigned int code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return c; - WCHAR wide_c; - if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) + wchar_t wide_c; + if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) return c; - WCHAR wide_result; - int b = ::LCMapStringW( + wchar_t wide_result; + int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW( idx, // locale identifier - LCMAP_UPPERCASE, // mapping transformation type + lcmap_uppercase, // mapping transformation type &wide_c, // source string 1, // number of characters in source string &wide_result, // destination buffer @@ -1103,7 +1238,7 @@ namespace BOOST_REGEX_DETAIL_NS { if (b == 0) return c; - if (::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0) + if (boost::BOOST_REGEX_DETAIL_NS::WideCharToMultiByte(code_page, 0, &wide_result, 1, result, 2, NULL, NULL) == 0) return c; // No single byte upper case equivalent available. #endif return result[0]; @@ -1113,9 +1248,9 @@ namespace BOOST_REGEX_DETAIL_NS { inline wchar_t w32_toupper(wchar_t c, lcid_type idx) { wchar_t result[2]; - int b = ::LCMapStringW( + int b = boost::BOOST_REGEX_DETAIL_NS::LCMapStringW( idx, // locale identifier - LCMAP_UPPERCASE, // mapping transformation type + lcmap_uppercase, // mapping transformation type &c, // source string 1, // number of characters in source string result, // destination buffer @@ -1127,20 +1262,20 @@ namespace BOOST_REGEX_DETAIL_NS { #endif inline bool w32_is(lcid_type idx, std::uint32_t m, char c) { - WORD mask; + word mask; #ifndef BOOST_NO_ANSI_APIS - if (::GetStringTypeExA(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExA(idx, ct_ctype1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) return true; #else - UINT code_page = get_code_page_for_locale_id(idx); + unsigned int code_page = get_code_page_for_locale_id(idx); if (code_page == 0) return false; - WCHAR wide_c; - if (::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) + wchar_t wide_c; + if (boost::BOOST_REGEX_DETAIL_NS::MultiByteToWideChar(code_page, 0, &c, 1, &wide_c, 1) == 0) return false; - if (::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &wide_c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) return true; #endif if ((m & w32_regex_traits_implementation::mask_word) && (c == '_')) @@ -1151,8 +1286,8 @@ namespace BOOST_REGEX_DETAIL_NS { #ifndef BOOST_NO_WREGEX inline bool w32_is(lcid_type idx, std::uint32_t m, wchar_t c) { - WORD mask; - if (::GetStringTypeExW(idx, CT_CTYPE1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) + word mask; + if (boost::BOOST_REGEX_DETAIL_NS::GetStringTypeExW(idx, ct_ctype1, &c, 1, &mask) && (mask & m & w32_regex_traits_implementation::mask_base)) return true; if ((m & w32_regex_traits_implementation::mask_word) && (c == '_')) return true; diff --git a/boostregex/boost/throw_exception.hpp b/boostregex/boost/throw_exception.hpp index 1699a6199..b8a2e4954 100644 --- a/boostregex/boost/throw_exception.hpp +++ b/boostregex/boost/throw_exception.hpp @@ -25,6 +25,7 @@ #include #include #include +#include #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_BORLANDC ) && BOOST_WORKAROUND( BOOST_BORLANDC, BOOST_TESTED_AT(0x593) ) # define BOOST_EXCEPTION_DISABLE @@ -51,7 +52,7 @@ typedef char (&wrapexcept_s2)[ 2 ]; template wrapexcept_s1 wrapexcept_is_convertible( T* ); template wrapexcept_s2 wrapexcept_is_convertible( void* ); -template( static_cast< E* >( 0 ) ) ) > struct wrapexcept_add_base; +template( static_cast< E* >( 0 ) ) ) > struct wrapexcept_add_base; template struct wrapexcept_add_base {