Fix compile errors of Solaris 2.6 and 2.7 using Sun's native WorkShop compilers, r=briano.

This commit is contained in:
nhotta%netscape.com 2000-01-06 19:46:17 +00:00
parent 034b27694c
commit 4d912e9e34

View File

@ -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));
}
}