diff options
| author | thegeorg <[email protected]> | 2023-05-10 12:10:46 +0300 |
|---|---|---|
| committer | thegeorg <[email protected]> | 2023-05-10 12:10:46 +0300 |
| commit | 9d5e6286a4a972c1b02226a218e7a4fdfe3a5faa (patch) | |
| tree | da99a10a4cc4895f85a32132c63d03a88d438a02 /contrib/restricted/boost/regex/src/posix_api.cpp | |
| parent | 1749dfa5623d0dc631585a665b8f32dfd32354af (diff) | |
Update contrib/restricted/boost/regex to 1.82.0
Diffstat (limited to 'contrib/restricted/boost/regex/src/posix_api.cpp')
| -rw-r--r-- | contrib/restricted/boost/regex/src/posix_api.cpp | 28 |
1 files changed, 10 insertions, 18 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) |
