Bug 209622 - bustage fix for stupid compilers (Sun WS and DEC OSF1) -

also remove unused configure test. r=dbaron sr=alecf
This commit is contained in:
bsmedberg%covad.net 2003-06-19 18:42:23 +00:00
parent 13f65a560a
commit 581fce1582
5 changed files with 33 additions and 64 deletions

View File

@ -2593,19 +2593,6 @@ if test "$ac_cv_cpp_partial_specialization" = yes ; then
AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
fi
dnl Some compilers support extern declarations of explicit template instantiations.
AC_CACHE_CHECK(for extern explicit template instantiation,
ac_cv_cpp_extern_instantiation,
[AC_TRY_COMPILE(template<class T> class Foo{ T a; };
extern template class Foo<int>;,
,
ac_cv_cpp_extern_instantiation=yes,
ac_cv_cpp_extern_instantiation=no)])
if test "$ac_cv_cpp_extern_instantiation" = yes ; then
AC_DEFINE(HAVE_CPP_EXTERN_INSTANTIATION)
fi
dnl Some compilers have limited support for operators with templates;
dnl specifically, it is necessary to define derived operators when a base
dnl class's operator declaration should suffice.
@ -4260,7 +4247,7 @@ dnl =========================================================
dnl = Chrome format
dnl =========================================================
MOZ_ARG_ENABLE_STRING(chrome-format,
[ --enable-chrome-format=FORMAT
[ --enable-chrome-format=jar|flat|both|symlink
Select FORMAT of chrome files (default=jar)],
MOZ_CHROME_FILE_FORMAT=`echo $enableval | tr A-Z a-z`)
@ -4270,8 +4257,9 @@ fi
if test "$MOZ_CHROME_FILE_FORMAT" != "jar" &&
test "$MOZ_CHROME_FILE_FORMAT" != "flat" &&
test "$MOZ_CHROME_FILE_FORMAT" != "symlink" &&
test "$MOZ_CHROME_FILE_FORMAT" != "both"; then
AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat or both])
AC_MSG_ERROR([--enable-chrome-format must be set to either jar, flat, both, or symlink])
fi
dnl ========================================================

View File

@ -208,7 +208,6 @@ typedef PRUint32 nsresult;
#if defined(_MSC_VER) && (_MSC_VER>=1100)
/* VC++ 5.0 and greater implement template specialization, 4.2 is unknown */
#define HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
#define HAVE_CPP_EXTERN_INSTANTIATION
#define HAVE_CPP_EXPLICIT
#define HAVE_CPP_TYPENAME

View File

@ -104,7 +104,7 @@ public:
* This function is especially useful for static hashtables.
* @return PR_TRUE if the table has been initialized.
*/
PRBool IsInitialized() const { return mTable.entrySize; }
PRBool IsInitialized() const { return this->mTable.entrySize; }
/**
* Return the number of entries in the table.
@ -186,7 +186,7 @@ public:
"nsBaseHashtable was not initialized properly.");
s_EnumReadArgs enumData = { enumFunc, userArg };
return PL_DHashTableEnumerate(NS_CONST_CAST(PLDHashTable*, &mTable),
return PL_DHashTableEnumerate(NS_CONST_CAST(PLDHashTable*, &this->mTable),
s_EnumReadStub,
&enumData);
}
@ -219,7 +219,7 @@ public:
"nsBaseHashtable was not initialized properly.");
s_EnumArgs enumData = { enumFunc, userArg };
return PL_DHashTableEnumerate(&mTable,
return PL_DHashTableEnumerate(&this->mTable,
s_EnumStub,
&enumData);
}
@ -230,10 +230,6 @@ public:
void Clear() { nsTHashtable<EntryType>::Clear(); }
protected:
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
using nsTHashtable<nsBaseHashtableET<KeyClass,DataType> >::mTable;
#endif
/**
* used internally during EnumerateRead. Allocated on the stack.
* @param func the enumerator passed to EnumerateRead
@ -294,10 +290,6 @@ public:
void Clear();
protected:
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
using nsTHashtable<EntryType>::mTable;
#endif
PRLock* mLock;
};
@ -365,8 +357,8 @@ nsBaseHashtable<KeyClass,DataType,UserDataType>::s_EnumStub
template<class KeyClass,class DataType,class UserDataType>
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::~nsBaseHashtableMT()
{
if (mLock)
PR_DestroyLock(mLock);
if (this->mLock)
PR_DestroyLock(this->mLock);
}
template<class KeyClass,class DataType,class UserDataType>
@ -376,19 +368,19 @@ nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Init(PRUint32 initSize)
if (!nsTHashtable<EntryType>::IsInitialized() && !nsTHashtable<EntryType>::Init(initSize))
return PR_FALSE;
mLock = PR_NewLock();
NS_WARN_IF_FALSE(mLock, "Error creating lock during nsBaseHashtableL::Init()");
this->mLock = PR_NewLock();
NS_WARN_IF_FALSE(this->mLock, "Error creating lock during nsBaseHashtableL::Init()");
return (mLock != nsnull);
return (this->mLock != nsnull);
}
template<class KeyClass,class DataType,class UserDataType>
PRUint32
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Count() const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRUint32 count = nsTHashtable<EntryType>::Count();
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return count;
}
@ -398,10 +390,10 @@ PRBool
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Get(KeyType aKey,
UserDataType* pData) const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRBool res =
nsBaseHashtable<KeyClass,DataType,UserDataType>::Get(aKey, pData);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return res;
}
@ -411,10 +403,10 @@ PRBool
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Put(KeyType aKey,
UserDataType aData)
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRBool res =
nsBaseHashtable<KeyClass,DataType,UserDataType>::Put(aKey, aData);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return res;
}
@ -423,9 +415,9 @@ template<class KeyClass,class DataType,class UserDataType>
void
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Remove(KeyType aKey)
{
PR_Lock(mLock);
PR_Lock(this->mLock);
nsBaseHashtable<KeyClass,DataType,UserDataType>::Remove(aKey);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
}
template<class KeyClass,class DataType,class UserDataType>
@ -433,10 +425,10 @@ PRUint32
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::EnumerateRead
(EnumReadFunction fEnumCall, void* userArg) const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRUint32 count =
nsBaseHashtable<KeyClass,DataType,UserDataType>::EnumerateRead(fEnumCall, userArg);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return count;
}
@ -446,10 +438,10 @@ PRUint32
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Enumerate
(EnumFunction fEnumCall, void* userArg)
{
PR_Lock(mLock);
PR_Lock(this->mLock);
PRUint32 count =
nsBaseHashtable<KeyClass,DataType,UserDataType>::Enumerate(fEnumCall, userArg);
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return count;
}
@ -458,9 +450,9 @@ template<class KeyClass,class DataType,class UserDataType>
void
nsBaseHashtableMT<KeyClass,DataType,UserDataType>::Clear()
{
PR_Lock(mLock);
PR_Lock(this->mLock);
nsBaseHashtable<KeyClass,DataType,UserDataType>::Clear();
PR_Unlock(mLock);
PR_Unlock(this->mLock);
}
#endif // nsBaseHashtable_h__

View File

@ -86,11 +86,6 @@ public:
* @param pData if the key doesn't exist, pData will be set to nsnull.
*/
PRBool Get(KeyType aKey, UserDataType* pData) const;
protected:
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
using nsBaseHashtableMT<KeyClass, nsAutoPtr<T>, T*>::mLock;
#endif
};
@ -117,7 +112,7 @@ nsClassHashtable<KeyClass,T>::Get(KeyType aKey, T** retVal) const
*retVal = nsnull;
return PR_FALSE;
};
}
//
@ -128,7 +123,7 @@ template<class KeyClass,class T>
PRBool
nsClassHashtableMT<KeyClass,T>::Get(KeyType aKey, T** retVal) const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
typename nsBaseHashtableMT<KeyClass,nsAutoPtr<T>,T*>::EntryType* ent =
GetEntry(aKey);
@ -138,7 +133,7 @@ nsClassHashtableMT<KeyClass,T>::Get(KeyType aKey, T** retVal) const
if (retVal)
*retVal = ent->mData;
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return PR_TRUE;
}
@ -146,9 +141,9 @@ nsClassHashtableMT<KeyClass,T>::Get(KeyType aKey, T** retVal) const
if (retVal)
*retVal = nsnull;
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return PR_FALSE;
};
}
#endif // nsClassHashtable_h__

View File

@ -86,11 +86,6 @@ public:
* If the key doesn't exist, pData will be set to nsnull.
*/
PRBool Get(KeyType aKey, UserDataType* pData) const;
protected:
#ifdef HAVE_CPP_AMBIGUITY_RESOLVING_USING
using nsBaseHashtableMT<KeyClass, nsCOMPtr<Interface>, Interface*>::mLock;
#endif
};
@ -136,7 +131,7 @@ PRBool
nsInterfaceHashtableMT<KeyClass,Interface>::Get
(KeyType aKey, UserDataType* pInterface) const
{
PR_Lock(mLock);
PR_Lock(this->mLock);
typename nsBaseHashtableMT<KeyClass, nsCOMPtr<Interface>, Interface*>::EntryType* ent =
GetEntry(aKey);
@ -150,7 +145,7 @@ nsInterfaceHashtableMT<KeyClass,Interface>::Get
NS_IF_ADDREF(*pInterface);
}
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return PR_TRUE;
}
@ -160,7 +155,7 @@ nsInterfaceHashtableMT<KeyClass,Interface>::Get
if (pInterface)
*pInterface = nsnull;
PR_Unlock(mLock);
PR_Unlock(this->mLock);
return PR_FALSE;
}