Instantiate more bcc32 v5.1 workarounds.

Fix for Chinese Win32 locales.
Don't test c_regex_traits if it's not present.


[SVN r31768]
This commit is contained in:
John Maddock
2005-11-24 16:37:05 +00:00
parent 1c2ff0ab50
commit 9d76e95575
3 changed files with 33 additions and 7 deletions

View File

@ -105,7 +105,14 @@ void w32_regex_traits_char_layer<char>::init()
for(int ii = 0; ii < (1 << CHAR_BIT); ++ii)
char_map[ii] = static_cast<char>(ii);
int r = ::LCMapStringA(this->m_locale, LCMAP_LOWERCASE, char_map, 1 << CHAR_BIT, this->m_lower_map, 1 << CHAR_BIT);
BOOST_ASSERT(r == 1 << CHAR_BIT);
BOOST_ASSERT(r != 0);
if(r < (1 << CHAR_BIT))
{
// if we have multibyte characters then not all may have been given
// a lower case mapping:
for(int jj = r; jj < (1 << CHAR_BIT); ++jj)
this->m_lower_map[jj] = static_cast<char>(jj);
}
r = ::GetStringTypeExA(this->m_locale, CT_CTYPE1, char_map, 1 << CHAR_BIT, this->m_type_map);
BOOST_ASSERT(0 != r);
}