mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-19 09:30:44 +00:00
Fix compile errors of Solaris 2.6 and 2.7 using Sun's native WorkShop compilers, r=briano.
This commit is contained in:
parent
034b27694c
commit
4d912e9e34
@ -41,6 +41,24 @@ static NS_DEFINE_CID(kLocaleServiceCID, NS_LOCALESERVICE_CID);
|
||||
NS_IMPL_ISUPPORTS(nsCollationUnix, kICollationIID);
|
||||
|
||||
|
||||
inline void nsCollationUnix::DoSetLocale()
|
||||
{
|
||||
char *locale = setlocale(LC_COLLATE, "");
|
||||
mSavedLocale.SetString(locale ? locale : "");
|
||||
if (!mSavedLocale.EqualsIgnoreCase(mLocale)) {
|
||||
char newLocale[128];
|
||||
(void) setlocale(LC_COLLATE, mLocale.ToCString(newLocale, 128));
|
||||
}
|
||||
}
|
||||
|
||||
inline void nsCollationUnix::DoRestoreLocale()
|
||||
{
|
||||
if (!mSavedLocale.EqualsIgnoreCase(mLocale)) {
|
||||
char oldLocale[128];
|
||||
(void) setlocale(LC_COLLATE, mSavedLocale.ToCString(oldLocale, 128));
|
||||
}
|
||||
}
|
||||
|
||||
nsCollationUnix::nsCollationUnix()
|
||||
{
|
||||
NS_INIT_REFCNT();
|
||||
@ -195,21 +213,3 @@ nsresult nsCollationUnix::CreateRawSortKey(const nsCollationStrength strength,
|
||||
return res;
|
||||
}
|
||||
|
||||
inline void nsCollationUnix::DoSetLocale()
|
||||
{
|
||||
char *locale = setlocale(LC_COLLATE, "");
|
||||
mSavedLocale.SetString(locale ? locale : "");
|
||||
if (!mSavedLocale.EqualsIgnoreCase(mLocale)) {
|
||||
char newLocale[128];
|
||||
(void) setlocale(LC_COLLATE, mLocale.ToCString(newLocale, 128));
|
||||
}
|
||||
}
|
||||
|
||||
inline void nsCollationUnix::DoRestoreLocale()
|
||||
{
|
||||
if (!mSavedLocale.EqualsIgnoreCase(mLocale)) {
|
||||
char oldLocale[128];
|
||||
(void) setlocale(LC_COLLATE, mSavedLocale.ToCString(oldLocale, 128));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user