locale _STLP_CALL locale::global(const locale& L) { locale old(_Stl_get_global_locale()->_M_impl); if (_Stl_get_global_locale()->_M_impl != L._M_impl) { _release_Locale_impl(_Stl_get_global_locale()->_M_impl); // this assign should be atomic, should be fixed here: _Stl_get_global_locale()->_M_impl = _get_Locale_impl(L._M_impl); // Set the global C locale, if appropriate. #if !defined(_STLP_NO_LOCALE_SUPPORT) && !defined(_STLP_WINCE) && !defined(_STLP_WCE_NET) if (L.name() != _Nameless) setlocale(LC_ALL, L.name().c_str()); #endif } return old; }
_Locale_impl* _STLP_CALL locale::global(const locale& L) { #endif locale old(_Stl_get_global_locale()->_M_impl); if (_Stl_get_global_locale()->_M_impl != L._M_impl) { _release_Locale_impl(_Stl_get_global_locale()->_M_impl); // this assign should be atomic, should be fixed here: _Stl_get_global_locale()->_M_impl = _get_Locale_impl(L._M_impl); // Set the global C locale, if appropriate. #if !defined(_STLP_NO_LOCALE_SUPPORT) if (L.name() != _Nameless) setlocale(LC_ALL, L.name().c_str()); #endif } #if !defined (_STLP_USE_MSVC6_MEM_T_BUG_WORKAROUND) return old; #else return old._M_impl; #endif }