diff --git a/src/c_regex_traits.cpp b/src/c_regex_traits.cpp index 1b1bcdd9..8de03a1e 100644 --- a/src/c_regex_traits.cpp +++ b/src/c_regex_traits.cpp @@ -58,7 +58,7 @@ namespace{ // helper function to get the locale name, // works around possibly broken setlocale implementations: // -const char* getlocale(int id) +const char* re_get_locale(int id) { static const char* def = "Unknown"; const char* pl = std::setlocale(id, 0); @@ -248,9 +248,9 @@ void BOOST_REGEX_CALL re_free_classes() void BOOST_REGEX_CALL re_update_classes() { BOOST_RE_GUARD_STACK - if(*re_cls_name != getlocale(LC_CTYPE)) + if(*re_cls_name != re_get_locale(LC_CTYPE)) { - *re_cls_name = getlocale(LC_CTYPE); + *re_cls_name = re_get_locale(LC_CTYPE); char buf[256]; unsigned int i; for(i = 0; i < re_classes_max; ++i) @@ -297,9 +297,9 @@ void BOOST_REGEX_CALL re_free_collate() void BOOST_REGEX_CALL re_update_collate() { BOOST_RE_GUARD_STACK - if(*re_coll_name != getlocale(LC_COLLATE)) + if(*re_coll_name != re_get_locale(LC_COLLATE)) { - *re_coll_name = getlocale(LC_COLLATE); + *re_coll_name = re_get_locale(LC_COLLATE); char buf[256]; unsigned int i = 400; re_get_message(buf, 256, i); @@ -361,7 +361,7 @@ void BOOST_REGEX_CALL re_message_update() // // called whenever the global locale changes: // - std::string l(getlocale(LC_MESSAGES)); + std::string l(re_get_locale(LC_MESSAGES)); if(*mess_locale != l) { *mess_locale = l; @@ -652,15 +652,15 @@ void BOOST_REGEX_CALL c_regex_traits::update() re_detail::cs_guard g(*re_detail::p_re_lock); #endif re_message_update(); - if(*collate_name != getlocale(LC_COLLATE)) + if(*collate_name != re_get_locale(LC_COLLATE)) { do_update_collate(); - *collate_name = getlocale(LC_COLLATE); + *collate_name = re_get_locale(LC_COLLATE); } - if(*ctype_name != getlocale(LC_CTYPE)) + if(*ctype_name != re_get_locale(LC_CTYPE)) { do_update_ctype(); - *ctype_name = getlocale(LC_CTYPE); + *ctype_name = re_get_locale(LC_CTYPE); } sort_type = re_detail::find_sort_syntax(&i, &sort_delim); } @@ -849,7 +849,7 @@ void BOOST_REGEX_CALL c_regex_traits::update() re_message_update(); re_update_classes(); re_update_collate(); - std::string l(getlocale(LC_CTYPE)); + std::string l(re_get_locale(LC_CTYPE)); if(*wlocale_name != l) { *wlocale_name = l;