Rewritten regex formatting code, refactored headers to reduce dependencies.

[SVN r22891]
This commit is contained in:
John Maddock
2004-05-22 11:04:22 +00:00
parent 03694d72ae
commit bdb4c091f1
33 changed files with 1001 additions and 690 deletions
+12 -2
View File
@@ -22,12 +22,22 @@
#ifndef BOOST_NO_WREGEX
#include <boost/cregex.hpp>
#include <boost/regex.hpp>
#include <cwchar>
#include <cstring>
#include <cstdio>
#if defined(BOOST_NO_STDC_NAMESPACE)
namespace std{
# ifndef BOOST_NO_SWPRINTF
using ::swprintf;
# endif
}
#endif
namespace boost{
namespace {
@@ -144,13 +154,13 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
{
if(std::wcscmp(e->re_endp, wnames[i]) == 0)
{
std::swprintf(localbuf, 5, L"%d", i);
(std::swprintf)(localbuf, 5, L"%d", i);
if(std::wcslen(localbuf) < buf_size)
std::wcscpy(buf, localbuf);
return std::wcslen(localbuf) + 1;
}
}
std::swprintf(localbuf, 5, L"%d", 0);
(std::swprintf)(localbuf, 5, L"%d", 0);
if(std::wcslen(localbuf) < buf_size)
std::wcscpy(buf, localbuf);
return std::wcslen(localbuf) + 1;