Allow source to be built by #including all the source files in a single TU.

Fixes #5736.

[SVN r74896]
This commit is contained in:
John Maddock
2011-10-10 15:09:40 +00:00
parent cc03c77deb
commit 852bc502cf
6 changed files with 76 additions and 48 deletions

View File

@ -74,7 +74,7 @@ const wchar_t* wnames[] = {
};
}
typedef boost::basic_regex<wchar_t, c_regex_traits<wchar_t> > c_regex_type;
typedef boost::basic_regex<wchar_t, c_regex_traits<wchar_t> > wc_regex_type;
BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wchar_t* ptr, int f)
{
@ -84,7 +84,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha
#ifndef BOOST_NO_EXCEPTIONS
try{
#endif
expression->guts = new c_regex_type();
expression->guts = new wc_regex_type();
#ifndef BOOST_NO_EXCEPTIONS
} catch(...)
{
@ -134,9 +134,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha
try{
#endif
expression->re_magic = wmagic_value;
static_cast<c_regex_type*>(expression->guts)->set_expression(ptr, p2, flags);
expression->re_nsub = static_cast<c_regex_type*>(expression->guts)->mark_count() - 1;
result = static_cast<c_regex_type*>(expression->guts)->error_code();
static_cast<wc_regex_type*>(expression->guts)->set_expression(ptr, p2, flags);
expression->re_nsub = static_cast<wc_regex_type*>(expression->guts)->mark_count() - 1;
result = static_cast<wc_regex_type*>(expression->guts)->error_code();
#ifndef BOOST_NO_EXCEPTIONS
}
catch(const boost::regex_error& be)
@ -215,7 +215,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW*
{
std::string p;
if((e) && (e->re_magic == wmagic_value))
p = static_cast<c_regex_type*>(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code));
p = static_cast<wc_regex_type*>(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code));
else
{
p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code));
@ -264,7 +264,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW* expression, cons
#endif
if(expression->re_magic == wmagic_value)
{
result = regex_search(start, end, m, *static_cast<c_regex_type*>(expression->guts), flags);
result = regex_search(start, end, m, *static_cast<wc_regex_type*>(expression->guts), flags);
}
else
return result;
@ -301,7 +301,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW* expression)
{
if(expression->re_magic == wmagic_value)
{
delete static_cast<c_regex_type*>(expression->guts);
delete static_cast<wc_regex_type*>(expression->guts);
}
expression->re_magic = 0;
}