From 362c85cf665b8b7b987760d734fcd53353dad49e Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 14 Dec 2022 13:06:33 +0000 Subject: [PATCH] Add swprintf workarounds. --- src/wide_posix_api.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wide_posix_api.cpp b/src/wide_posix_api.cpp index 5ca4c7ae..e55fadb5 100644 --- a/src/wide_posix_api.cpp +++ b/src/wide_posix_api.cpp @@ -25,6 +25,12 @@ #include #include +#ifndef BOOST_REGEX_STANDALONE +#include +#else +namespace boost { namespace core { using std::swprintf; } } +#endif + #ifndef BOOST_WORKAROUND #define BOOST_WORKAROUND(x, y) false #endif @@ -185,7 +191,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) @@ -199,7 +205,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)