diff options
author | thegeorg <thegeorg@yandex-team.com> | 2023-05-10 12:10:46 +0300 |
---|---|---|
committer | thegeorg <thegeorg@yandex-team.com> | 2023-05-10 12:10:46 +0300 |
commit | 9d5e6286a4a972c1b02226a218e7a4fdfe3a5faa (patch) | |
tree | da99a10a4cc4895f85a32132c63d03a88d438a02 /contrib/restricted/boost/regex/src | |
parent | 1749dfa5623d0dc631585a665b8f32dfd32354af (diff) | |
download | ydb-9d5e6286a4a972c1b02226a218e7a4fdfe3a5faa.tar.gz |
Update contrib/restricted/boost/regex to 1.82.0
Diffstat (limited to 'contrib/restricted/boost/regex/src')
-rw-r--r-- | contrib/restricted/boost/regex/src/posix_api.cpp | 28 | ||||
-rw-r--r-- | contrib/restricted/boost/regex/src/wide_posix_api.cpp | 27 |
2 files changed, 23 insertions, 32 deletions
diff --git a/contrib/restricted/boost/regex/src/posix_api.cpp b/contrib/restricted/boost/regex/src/posix_api.cpp index 95978e43117..e30f9d8e1ec 100644 --- a/contrib/restricted/boost/regex/src/posix_api.cpp +++ b/contrib/restricted/boost/regex/src/posix_api.cpp @@ -18,19 +18,19 @@ #define BOOST_REGEX_SOURCE -#include <boost/config.hpp> #include <boost/regex.hpp> #include <boost/cregex.hpp> #include <cstdio> -#if defined(BOOST_NO_STDC_NAMESPACE) -namespace std{ - using ::sprintf; - using ::strcpy; - using ::strcmp; -} +#ifndef BOOST_WORKAROUND +#define BOOST_WORKAROUND(x, y) false #endif +#ifndef BOOST_REGEX_STANDALONE +#include <boost/core/snprintf.hpp> +#else +namespace boost { namespace core { using std::snprintf; } } +#endif namespace boost{ @@ -87,7 +87,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompA(regex_tA* expression, const char return REG_E_MEMORY; #endif // set default flags: - boost::uint_fast32_t flags = (f & REG_PERLEX) ? 0 : ((f & REG_EXTENDED) ? regex::extended : regex::basic); + unsigned flags = (f & REG_PERLEX) ? 0 : ((f & REG_EXTENDED) ? regex::extended : regex::basic); expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : match_default; // and translate those that are actually set: @@ -176,11 +176,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* // We're converting an integer i to a string, and since i <= REG_E_UNKNOWN // a five character string is *always* large enough: // -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE) - int r = (::sprintf_s)(localbuf, 5, "%d", i); -#else - int r = (std::sprintf)(localbuf, "%d", i); -#endif + int r = (boost::core::snprintf)(localbuf, 5, "%d", i); if(r < 0) return 0; // sprintf failed if(std::strlen(localbuf) < buf_size) @@ -188,11 +184,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* return std::strlen(localbuf) + 1; } } -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE) - int r = (::sprintf_s)(localbuf, 5, "%d", 0); -#else - int r = (std::sprintf)(localbuf, "%d", 0); -#endif + int r = (boost::core::snprintf)(localbuf, 5, "%d", 0); if(r < 0) return 0; // sprintf failed if(std::strlen(localbuf) < buf_size) diff --git a/contrib/restricted/boost/regex/src/wide_posix_api.cpp b/contrib/restricted/boost/regex/src/wide_posix_api.cpp index abd68c59786..993464f86b6 100644 --- a/contrib/restricted/boost/regex/src/wide_posix_api.cpp +++ b/contrib/restricted/boost/regex/src/wide_posix_api.cpp @@ -25,6 +25,16 @@ #include <boost/regex.hpp> #include <boost/cregex.hpp> +#ifndef BOOST_REGEX_STANDALONE +#include <boost/core/snprintf.hpp> +#else +namespace boost { namespace core { using std::swprintf; } } +#endif + +#ifndef BOOST_WORKAROUND +#define BOOST_WORKAROUND(x, y) false +#endif + #include <cstdio> #include <cstring> #include <cwchar> @@ -33,15 +43,6 @@ #pragma warning(disable:981) #endif -#if defined(BOOST_NO_STDC_NAMESPACE) || defined(__NetBSD__) -namespace std{ -# ifndef BOOST_NO_SWPRINTF - using ::swprintf; -# endif -} -#endif - - namespace boost{ namespace { @@ -97,7 +98,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha return REG_E_MEMORY; #endif // set default flags: - boost::uint_fast32_t flags = (f & REG_PERLEX) ? 0 : ((f & REG_EXTENDED) ? wregex::extended : wregex::basic); + unsigned flags = (f & REG_PERLEX) ? 0 : ((f & REG_EXTENDED) ? wregex::extended : wregex::basic); expression->eflags = (f & REG_NEWLINE) ? match_not_dot_newline : match_default; // and translate those that are actually set: @@ -177,7 +178,6 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* } return result; } -#if !defined(BOOST_NO_SWPRINTF) if(code == REG_ATOI) { wchar_t localbuf[5]; @@ -190,7 +190,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* #if defined(_WIN32_WCE) && !defined(UNDER_CE) (std::swprintf)(localbuf, L"%d", i); #else - (std::swprintf)(localbuf, 5, L"%d", i); + (boost::core::swprintf)(localbuf, 5, L"%d", i); #endif if(std::wcslen(localbuf) < buf_size) #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE) @@ -204,7 +204,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* #if defined(_WIN32_WCE) && !defined(UNDER_CE) (std::swprintf)(localbuf, L"%d", 0); #else - (std::swprintf)(localbuf, 5, L"%d", 0); + (boost::core::swprintf)(localbuf, 5, L"%d", 0); #endif if(std::wcslen(localbuf) < buf_size) #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE) @@ -214,7 +214,6 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* #endif return std::wcslen(localbuf) + 1; } -#endif if(code <= (int)REG_E_UNKNOWN) { std::string p; |