diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2023-01-09 22:20:57 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2023-01-09 22:20:57 +0300 |
commit | 2d79b278f2265d09c965faf97288acceb21da600 (patch) | |
tree | e6e2d9dd06c566aa9eab213456228c9b7ecb07c9 /contrib/restricted/boost/regex/src/regex.cpp | |
parent | 686f4f5fb194fae77e30db2dadf9f9166c65d1de (diff) | |
download | ydb-2d79b278f2265d09c965faf97288acceb21da600.tar.gz |
Update contrib/restricted/boost/regex to 1.81.0
Diffstat (limited to 'contrib/restricted/boost/regex/src/regex.cpp')
-rw-r--r-- | contrib/restricted/boost/regex/src/regex.cpp | 131 |
1 files changed, 10 insertions, 121 deletions
diff --git a/contrib/restricted/boost/regex/src/regex.cpp b/contrib/restricted/boost/regex/src/regex.cpp index a9e98f07cc..2d9239553c 100644 --- a/contrib/restricted/boost/regex/src/regex.cpp +++ b/contrib/restricted/boost/regex/src/regex.cpp @@ -19,15 +19,12 @@ #define BOOST_REGEX_SOURCE -#include <boost/config.hpp> -#include <new> -#include <boost/regex.hpp> -#include <boost/throw_exception.hpp> +#include <boost/regex/config.hpp> -#if defined(BOOST_REGEX_HAS_MS_STACK_GUARD) && defined(_MSC_VER) && (_MSC_VER >= 1300) -# include <malloc.h> -#endif #ifdef BOOST_REGEX_HAS_MS_STACK_GUARD + +#include <malloc.h> + #ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN #endif @@ -37,78 +34,12 @@ #define NOGDI #define NOUSER #include <windows.h> -#endif - -#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_REGEX_V3) -#if BOOST_REGEX_MAX_CACHE_BLOCKS == 0 -#include <new> -#else -#include <boost/regex/v4/mem_block_cache.hpp> -#endif -#endif +#include <stdexcept> +#include <boost/regex/pattern_except.hpp> +#include <boost/regex/v4/protected_call.hpp> -#ifdef BOOST_INTEL -#pragma warning(disable:383) -#endif - -namespace boost{ - -// -// fix: these are declared out of line here to ensure -// that dll builds contain the Virtual table for these -// types - this ensures that exceptions can be thrown -// from the dll and caught in an exe. -regex_error::regex_error(const std::string& s, regex_constants::error_type err, std::ptrdiff_t pos) - : std::runtime_error(s) - , m_error_code(err) - , m_position(pos) -{ -} - -regex_error::regex_error(regex_constants::error_type err) - : std::runtime_error(::boost::BOOST_REGEX_DETAIL_NS::get_default_error_string(err)) - , m_error_code(err) - , m_position(0) -{ -} - -regex_error::~regex_error() -{ -} - -void regex_error::raise()const -{ -#ifndef BOOST_NO_EXCEPTIONS - ::boost::throw_exception(*this); -#endif -} - - - -namespace BOOST_REGEX_DETAIL_NS{ - -BOOST_REGEX_DECL void BOOST_REGEX_CALL raise_runtime_error(const std::runtime_error& ex) -{ - ::boost::throw_exception(ex); -} -// -// error checking API: -// -BOOST_REGEX_DECL void BOOST_REGEX_CALL verify_options(boost::regex::flag_type /*ef*/, match_flag_type mf) -{ -#ifndef BOOST_REGEX_V3 - // - // can't mix match_extra with POSIX matching rules: - // - if((mf & match_extra) && (mf & match_posix)) - { - std::logic_error msg("Usage Error: Can't mix regular expression captures with POSIX matching rules"); - throw_exception(msg); - } -#endif -} - -#ifdef BOOST_REGEX_HAS_MS_STACK_GUARD +namespace boost { +namespace BOOST_REGEX_DETAIL_NS { static void execute_eror() { @@ -175,52 +106,10 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL reset_stack_guard_page() } #endif } -#endif - -#if defined(BOOST_REGEX_NON_RECURSIVE) && !defined(BOOST_REGEX_V3) - -#if BOOST_REGEX_MAX_CACHE_BLOCKS == 0 - -BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block() -{ - return ::operator new(BOOST_REGEX_BLOCKSIZE); -} - -BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p) -{ - ::operator delete(p); -} - -#else - -#if defined(BOOST_REGEX_MEM_BLOCK_CACHE_LOCK_FREE) -mem_block_cache block_cache = { { {nullptr} } } ; -#elif defined(BOOST_HAS_THREADS) -mem_block_cache block_cache = { 0, 0, BOOST_STATIC_MUTEX_INIT, }; -#else -mem_block_cache block_cache = { 0, 0, }; -#endif - -BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block() -{ - return block_cache.get(); -} - -BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p) -{ - block_cache.put(p); } - -#endif - +} // namspaces #endif -} // namespace BOOST_REGEX_DETAIL_NS - - - -} // namespace boost - #if defined(BOOST_RE_USE_VCL) && defined(BOOST_REGEX_DYN_LINK) int WINAPI DllEntryPoint(HINSTANCE , unsigned long , void*) |