forked from boostorg/regex
Compare commits
5 Commits
test_stand
...
develop
Author | SHA1 | Date | |
---|---|---|---|
237e69caf6 | |||
372d3f7a7e | |||
362c85cf66 | |||
430419705b | |||
1cad53766e |
@ -22,19 +22,15 @@
|
|||||||
#include <boost/cregex.hpp>
|
#include <boost/cregex.hpp>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
#if defined(BOOST_NO_STDC_NAMESPACE)
|
|
||||||
namespace std{
|
|
||||||
using ::sprintf;
|
|
||||||
using ::strcpy;
|
|
||||||
using ::strcmp;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef BOOST_WORKAROUND
|
#ifndef BOOST_WORKAROUND
|
||||||
#define BOOST_WORKAROUND(x, y) false
|
#define BOOST_WORKAROUND(x, y) false
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef BOOST_REGEX_STANDALONE
|
||||||
|
#include <boost/core/snprintf.hpp>
|
||||||
|
#else
|
||||||
|
namespace boost { namespace core { using std::snprintf; } }
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
@ -180,13 +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
|
// We're converting an integer i to a string, and since i <= REG_E_UNKNOWN
|
||||||
// a five character string is *always* large enough:
|
// a five character string is *always* large enough:
|
||||||
//
|
//
|
||||||
#if !defined(BOOST_CXX_VERSION) || (BOOST_CXX_VERSION >= 201103)
|
int r = (boost::core::snprintf)(localbuf, 5, "%d", i);
|
||||||
int r = (std::snprintf)(localbuf, 5, "%d", i);
|
|
||||||
#elif 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
|
|
||||||
if(r < 0)
|
if(r < 0)
|
||||||
return 0; // sprintf failed
|
return 0; // sprintf failed
|
||||||
if(std::strlen(localbuf) < buf_size)
|
if(std::strlen(localbuf) < buf_size)
|
||||||
@ -194,13 +184,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA*
|
|||||||
return std::strlen(localbuf) + 1;
|
return std::strlen(localbuf) + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if !defined(BOOST_CXX_VERSION) || (BOOST_CXX_VERSION >= 201103)
|
int r = (boost::core::snprintf)(localbuf, 5, "%d", 0);
|
||||||
int r = (::snprintf)(localbuf, 5, "%d", 0);
|
|
||||||
#elif 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
|
|
||||||
if(r < 0)
|
if(r < 0)
|
||||||
return 0; // sprintf failed
|
return 0; // sprintf failed
|
||||||
if(std::strlen(localbuf) < buf_size)
|
if(std::strlen(localbuf) < buf_size)
|
||||||
|
@ -25,6 +25,12 @@
|
|||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
#include <boost/cregex.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
|
#ifndef BOOST_WORKAROUND
|
||||||
#define BOOST_WORKAROUND(x, y) false
|
#define BOOST_WORKAROUND(x, y) false
|
||||||
#endif
|
#endif
|
||||||
@ -37,15 +43,6 @@
|
|||||||
#pragma warning(disable:981)
|
#pragma warning(disable:981)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOST_NO_STDC_NAMESPACE) || defined(__NetBSD__)
|
|
||||||
namespace std{
|
|
||||||
# ifndef BOOST_NO_SWPRINTF
|
|
||||||
using ::swprintf;
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
namespace boost{
|
namespace boost{
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@ -181,7 +178,6 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
#if !defined(BOOST_NO_SWPRINTF)
|
|
||||||
if(code == REG_ATOI)
|
if(code == REG_ATOI)
|
||||||
{
|
{
|
||||||
wchar_t localbuf[5];
|
wchar_t localbuf[5];
|
||||||
@ -194,7 +190,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
|
|||||||
#if defined(_WIN32_WCE) && !defined(UNDER_CE)
|
#if defined(_WIN32_WCE) && !defined(UNDER_CE)
|
||||||
(std::swprintf)(localbuf, L"%d", i);
|
(std::swprintf)(localbuf, L"%d", i);
|
||||||
#else
|
#else
|
||||||
(std::swprintf)(localbuf, 5, L"%d", i);
|
(boost::core::swprintf)(localbuf, 5, L"%d", i);
|
||||||
#endif
|
#endif
|
||||||
if(std::wcslen(localbuf) < buf_size)
|
if(std::wcslen(localbuf) < buf_size)
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
||||||
@ -208,7 +204,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
|
|||||||
#if defined(_WIN32_WCE) && !defined(UNDER_CE)
|
#if defined(_WIN32_WCE) && !defined(UNDER_CE)
|
||||||
(std::swprintf)(localbuf, L"%d", 0);
|
(std::swprintf)(localbuf, L"%d", 0);
|
||||||
#else
|
#else
|
||||||
(std::swprintf)(localbuf, 5, L"%d", 0);
|
(boost::core::swprintf)(localbuf, 5, L"%d", 0);
|
||||||
#endif
|
#endif
|
||||||
if(std::wcslen(localbuf) < buf_size)
|
if(std::wcslen(localbuf) < buf_size)
|
||||||
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE)
|
||||||
@ -218,7 +214,6 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
|
|||||||
#endif
|
#endif
|
||||||
return std::wcslen(localbuf) + 1;
|
return std::wcslen(localbuf) + 1;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if(code <= (int)REG_E_UNKNOWN)
|
if(code <= (int)REG_E_UNKNOWN)
|
||||||
{
|
{
|
||||||
std::string p;
|
std::string p;
|
||||||
|
Reference in New Issue
Block a user