Bug 680625 part 0b: Remove more workarounds for past century compilers. r=ted
This commit is contained in:
27
configure.in
27
configure.in
@@ -3850,32 +3850,6 @@ if test "$ac_cv_cpp_partial_specialization" = yes ; then
|
||||
AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
|
||||
fi
|
||||
|
||||
dnl Some compilers have trouble resolving the ambiguity between two
|
||||
dnl functions whose arguments differ only by cv-qualifications.
|
||||
AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
|
||||
ac_cv_can_resolve_const_ambiguity,
|
||||
[AC_TRY_COMPILE([
|
||||
template <class T> class ptrClass {
|
||||
public: T* ptr;
|
||||
};
|
||||
|
||||
template <class T> T* a(ptrClass<T> *arg) {
|
||||
return arg->ptr;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const T* a(const ptrClass<T> *arg) {
|
||||
return arg->ptr;
|
||||
}
|
||||
],
|
||||
[ ptrClass<int> i;
|
||||
a(&i); ],
|
||||
ac_cv_can_resolve_const_ambiguity=yes,
|
||||
ac_cv_can_resolve_const_ambiguity=no)])
|
||||
if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
|
||||
AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
|
||||
fi
|
||||
|
||||
dnl Check to see if we can resolve ambiguity with |using|.
|
||||
AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
|
||||
ac_cv_cpp_ambiguity_resolving_using,
|
||||
@@ -8963,7 +8937,6 @@ _NON_GLOBAL_ACDEFINES="$_NON_GLOBAL_ACDEFINES
|
||||
CPP_THROW_NEW
|
||||
HAVE_CPP_2BYTE_WCHAR_T
|
||||
HAVE_CPP_AMBIGUITY_RESOLVING_USING
|
||||
HAVE_CPP_BOOL
|
||||
HAVE_CPP_CHAR16_T
|
||||
HAVE_CPP_DYNAMIC_CAST_TO_VOID_PTR
|
||||
HAVE_CPP_MODERN_SPECIALIZE_TEMPLATE_SYNTAX
|
||||
|
||||
@@ -3770,32 +3770,6 @@ if test "$ac_cv_cpp_partial_specialization" = yes ; then
|
||||
AC_DEFINE(HAVE_CPP_PARTIAL_SPECIALIZATION)
|
||||
fi
|
||||
|
||||
dnl Some compilers have trouble resolving the ambiguity between two
|
||||
dnl functions whose arguments differ only by cv-qualifications.
|
||||
AC_CACHE_CHECK(whether the compiler can resolve const ambiguities for templates,
|
||||
ac_cv_can_resolve_const_ambiguity,
|
||||
[AC_TRY_COMPILE([
|
||||
template <class T> class ptrClass {
|
||||
public: T* ptr;
|
||||
};
|
||||
|
||||
template <class T> T* a(ptrClass<T> *arg) {
|
||||
return arg->ptr;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
const T* a(const ptrClass<T> *arg) {
|
||||
return arg->ptr;
|
||||
}
|
||||
],
|
||||
[ ptrClass<int> i;
|
||||
a(&i); ],
|
||||
ac_cv_can_resolve_const_ambiguity=yes,
|
||||
ac_cv_can_resolve_const_ambiguity=no)])
|
||||
if test "$ac_cv_can_resolve_const_ambiguity" = no ; then
|
||||
AC_DEFINE(CANT_RESOLVE_CPP_CONST_AMBIGUITY)
|
||||
fi
|
||||
|
||||
dnl Check to see if we can resolve ambiguity with |using|.
|
||||
AC_CACHE_CHECK(whether the C++ \"using\" keyword resolves ambiguity,
|
||||
ac_cv_cpp_ambiguity_resolving_using,
|
||||
|
||||
@@ -245,19 +245,6 @@ class nsHtml5RefPtr
|
||||
return get();
|
||||
}
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
// broken version for IRIX
|
||||
|
||||
nsHtml5RefPtr<T>*
|
||||
get_address() const
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
// below.
|
||||
{
|
||||
return const_cast<nsHtml5RefPtr<T>*>(this);
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
nsHtml5RefPtr<T>*
|
||||
get_address()
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
@@ -274,8 +261,6 @@ class nsHtml5RefPtr
|
||||
return this;
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
public:
|
||||
T&
|
||||
operator*() const
|
||||
@@ -296,20 +281,6 @@ class nsHtml5RefPtr
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
// This is the broken version for IRIX, which can't handle the version below.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsHtml5RefPtr<T>*
|
||||
address_of( const nsHtml5RefPtr<T>& aPtr )
|
||||
{
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsHtml5RefPtr<T>*
|
||||
@@ -326,8 +297,6 @@ address_of( const nsHtml5RefPtr<T>& aPtr )
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
class nsHtml5RefPtrGetterAddRefs
|
||||
/*
|
||||
@@ -394,7 +363,7 @@ getter_AddRefs( nsHtml5RefPtr<T>& aSmartPtr )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsHtml5RefPtr<T>& lhs, const nsHtml5RefPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs.get());
|
||||
@@ -403,7 +372,7 @@ operator==( const nsHtml5RefPtr<T>& lhs, const nsHtml5RefPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsHtml5RefPtr<T>& lhs, const nsHtml5RefPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs.get());
|
||||
@@ -414,7 +383,7 @@ operator!=( const nsHtml5RefPtr<T>& lhs, const nsHtml5RefPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsHtml5RefPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs);
|
||||
@@ -422,7 +391,7 @@ operator==( const nsHtml5RefPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const U* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
{
|
||||
return static_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -430,7 +399,7 @@ operator==( const U* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsHtml5RefPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs);
|
||||
@@ -438,7 +407,7 @@ operator!=( const nsHtml5RefPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const U* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
{
|
||||
return static_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -454,7 +423,7 @@ operator!=( const U* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsHtml5RefPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == const_cast<const U*>(rhs);
|
||||
@@ -462,7 +431,7 @@ operator==( const nsHtml5RefPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( U* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -470,7 +439,7 @@ operator==( U* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsHtml5RefPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != const_cast<const U*>(rhs);
|
||||
@@ -478,7 +447,7 @@ operator!=( const nsHtml5RefPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( U* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -491,7 +460,7 @@ operator!=( U* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsHtml5RefPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -500,7 +469,7 @@ operator==( const nsHtml5RefPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( NSCAP_Zero* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
@@ -509,7 +478,7 @@ operator==( NSCAP_Zero* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsHtml5RefPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr != 0|
|
||||
{
|
||||
@@ -518,7 +487,7 @@ operator!=( const nsHtml5RefPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( NSCAP_Zero* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
// specifically to allow |0 != smartPtr|
|
||||
{
|
||||
@@ -533,7 +502,7 @@ operator!=( NSCAP_Zero* lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsHtml5RefPtr<T>& lhs, int rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -542,7 +511,7 @@ operator==( const nsHtml5RefPtr<T>& lhs, int rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( int lhs, const nsHtml5RefPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
|
||||
@@ -197,19 +197,6 @@ class nsAutoPtr
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
// broken version for IRIX
|
||||
|
||||
nsAutoPtr<T>*
|
||||
get_address() const
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
// below.
|
||||
{
|
||||
return const_cast<nsAutoPtr<T>*>(this);
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
nsAutoPtr<T>*
|
||||
get_address()
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
@@ -226,8 +213,6 @@ class nsAutoPtr
|
||||
return this;
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
public:
|
||||
T&
|
||||
operator*() const
|
||||
@@ -248,20 +233,6 @@ class nsAutoPtr
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
// This is the broken version for IRIX, which can't handle the version below.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsAutoPtr<T>*
|
||||
address_of( const nsAutoPtr<T>& aPtr )
|
||||
{
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsAutoPtr<T>*
|
||||
@@ -278,8 +249,6 @@ address_of( const nsAutoPtr<T>& aPtr )
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
class nsAutoPtrGetterTransfers
|
||||
/*
|
||||
@@ -346,7 +315,7 @@ getter_Transfers( nsAutoPtr<T>& aSmartPtr )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoPtr<T>& lhs, const nsAutoPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs.get());
|
||||
@@ -355,7 +324,7 @@ operator==( const nsAutoPtr<T>& lhs, const nsAutoPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsAutoPtr<T>& lhs, const nsAutoPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs.get());
|
||||
@@ -366,7 +335,7 @@ operator!=( const nsAutoPtr<T>& lhs, const nsAutoPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs);
|
||||
@@ -374,7 +343,7 @@ operator==( const nsAutoPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const U* lhs, const nsAutoPtr<T>& rhs )
|
||||
{
|
||||
return static_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -382,7 +351,7 @@ operator==( const U* lhs, const nsAutoPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsAutoPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs);
|
||||
@@ -390,7 +359,7 @@ operator!=( const nsAutoPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const U* lhs, const nsAutoPtr<T>& rhs )
|
||||
{
|
||||
return static_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -406,7 +375,7 @@ operator!=( const U* lhs, const nsAutoPtr<T>& rhs )
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == const_cast<const U*>(rhs);
|
||||
@@ -414,7 +383,7 @@ operator==( const nsAutoPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( U* lhs, const nsAutoPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -422,7 +391,7 @@ operator==( U* lhs, const nsAutoPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsAutoPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != const_cast<const U*>(rhs);
|
||||
@@ -430,7 +399,7 @@ operator!=( const nsAutoPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( U* lhs, const nsAutoPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -443,7 +412,7 @@ operator!=( U* lhs, const nsAutoPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -452,7 +421,7 @@ operator==( const nsAutoPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( NSCAP_Zero* lhs, const nsAutoPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
@@ -461,7 +430,7 @@ operator==( NSCAP_Zero* lhs, const nsAutoPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsAutoPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr != 0|
|
||||
{
|
||||
@@ -470,7 +439,7 @@ operator!=( const nsAutoPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( NSCAP_Zero* lhs, const nsAutoPtr<T>& rhs )
|
||||
// specifically to allow |0 != smartPtr|
|
||||
{
|
||||
@@ -485,7 +454,7 @@ operator!=( NSCAP_Zero* lhs, const nsAutoPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoPtr<T>& lhs, int rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -494,7 +463,7 @@ operator==( const nsAutoPtr<T>& lhs, int rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( int lhs, const nsAutoPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
@@ -617,19 +586,6 @@ class nsAutoArrayPtr
|
||||
return get();
|
||||
}
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
// broken version for IRIX
|
||||
|
||||
nsAutoArrayPtr<T>*
|
||||
get_address() const
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
// below.
|
||||
{
|
||||
return const_cast<nsAutoArrayPtr<T>*>(this);
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
nsAutoArrayPtr<T>*
|
||||
get_address()
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
@@ -646,8 +602,6 @@ class nsAutoArrayPtr
|
||||
return this;
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
public:
|
||||
T&
|
||||
operator*() const
|
||||
@@ -668,20 +622,6 @@ class nsAutoArrayPtr
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
// This is the broken version for IRIX, which can't handle the version below.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsAutoArrayPtr<T>*
|
||||
address_of( const nsAutoArrayPtr<T>& aPtr )
|
||||
{
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsAutoArrayPtr<T>*
|
||||
@@ -698,8 +638,6 @@ address_of( const nsAutoArrayPtr<T>& aPtr )
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
class nsAutoArrayPtrGetterTransfers
|
||||
/*
|
||||
@@ -766,7 +704,7 @@ getter_Transfers( nsAutoArrayPtr<T>& aSmartPtr )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoArrayPtr<T>& lhs, const nsAutoArrayPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs.get());
|
||||
@@ -775,7 +713,7 @@ operator==( const nsAutoArrayPtr<T>& lhs, const nsAutoArrayPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsAutoArrayPtr<T>& lhs, const nsAutoArrayPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs.get());
|
||||
@@ -786,7 +724,7 @@ operator!=( const nsAutoArrayPtr<T>& lhs, const nsAutoArrayPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoArrayPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs);
|
||||
@@ -794,7 +732,7 @@ operator==( const nsAutoArrayPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const U* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
{
|
||||
return static_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -802,7 +740,7 @@ operator==( const U* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsAutoArrayPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs);
|
||||
@@ -810,7 +748,7 @@ operator!=( const nsAutoArrayPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const U* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
{
|
||||
return static_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -826,7 +764,7 @@ operator!=( const U* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoArrayPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == const_cast<const U*>(rhs);
|
||||
@@ -834,7 +772,7 @@ operator==( const nsAutoArrayPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( U* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -842,7 +780,7 @@ operator==( U* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsAutoArrayPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != const_cast<const U*>(rhs);
|
||||
@@ -850,7 +788,7 @@ operator!=( const nsAutoArrayPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( U* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -863,7 +801,7 @@ operator!=( U* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoArrayPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -872,7 +810,7 @@ operator==( const nsAutoArrayPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( NSCAP_Zero* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
@@ -881,7 +819,7 @@ operator==( NSCAP_Zero* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsAutoArrayPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr != 0|
|
||||
{
|
||||
@@ -890,7 +828,7 @@ operator!=( const nsAutoArrayPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( NSCAP_Zero* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
// specifically to allow |0 != smartPtr|
|
||||
{
|
||||
@@ -905,7 +843,7 @@ operator!=( NSCAP_Zero* lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsAutoArrayPtr<T>& lhs, int rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -914,7 +852,7 @@ operator==( const nsAutoArrayPtr<T>& lhs, int rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( int lhs, const nsAutoArrayPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
@@ -1131,19 +1069,6 @@ class nsRefPtr
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
// broken version for IRIX
|
||||
|
||||
nsRefPtr<T>*
|
||||
get_address() const
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
// below.
|
||||
{
|
||||
return const_cast<nsRefPtr<T>*>(this);
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
nsRefPtr<T>*
|
||||
get_address()
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
@@ -1160,8 +1085,6 @@ class nsRefPtr
|
||||
return this;
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
public:
|
||||
T&
|
||||
operator*() const
|
||||
@@ -1182,20 +1105,6 @@ class nsRefPtr
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
// This is the broken version for IRIX, which can't handle the version below.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsRefPtr<T>*
|
||||
address_of( const nsRefPtr<T>& aPtr )
|
||||
{
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsRefPtr<T>*
|
||||
@@ -1212,8 +1121,6 @@ address_of( const nsRefPtr<T>& aPtr )
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
class nsRefPtrGetterAddRefs
|
||||
/*
|
||||
@@ -1280,7 +1187,7 @@ getter_AddRefs( nsRefPtr<T>& aSmartPtr )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsRefPtr<T>& lhs, const nsRefPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs.get());
|
||||
@@ -1289,7 +1196,7 @@ operator==( const nsRefPtr<T>& lhs, const nsRefPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsRefPtr<T>& lhs, const nsRefPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs.get());
|
||||
@@ -1300,7 +1207,7 @@ operator!=( const nsRefPtr<T>& lhs, const nsRefPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsRefPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs);
|
||||
@@ -1308,7 +1215,7 @@ operator==( const nsRefPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const U* lhs, const nsRefPtr<T>& rhs )
|
||||
{
|
||||
return static_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -1316,7 +1223,7 @@ operator==( const U* lhs, const nsRefPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsRefPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs);
|
||||
@@ -1324,7 +1231,7 @@ operator!=( const nsRefPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const U* lhs, const nsRefPtr<T>& rhs )
|
||||
{
|
||||
return static_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -1340,7 +1247,7 @@ operator!=( const U* lhs, const nsRefPtr<T>& rhs )
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsRefPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == const_cast<const U*>(rhs);
|
||||
@@ -1348,7 +1255,7 @@ operator==( const nsRefPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( U* lhs, const nsRefPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -1356,7 +1263,7 @@ operator==( U* lhs, const nsRefPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsRefPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != const_cast<const U*>(rhs);
|
||||
@@ -1364,7 +1271,7 @@ operator!=( const nsRefPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( U* lhs, const nsRefPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -1377,7 +1284,7 @@ operator!=( U* lhs, const nsRefPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsRefPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -1386,7 +1293,7 @@ operator==( const nsRefPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( NSCAP_Zero* lhs, const nsRefPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
@@ -1395,7 +1302,7 @@ operator==( NSCAP_Zero* lhs, const nsRefPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsRefPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr != 0|
|
||||
{
|
||||
@@ -1404,7 +1311,7 @@ operator!=( const nsRefPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( NSCAP_Zero* lhs, const nsRefPtr<T>& rhs )
|
||||
// specifically to allow |0 != smartPtr|
|
||||
{
|
||||
@@ -1419,7 +1326,7 @@ operator!=( NSCAP_Zero* lhs, const nsRefPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsRefPtr<T>& lhs, int rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -1428,7 +1335,7 @@ operator==( const nsRefPtr<T>& lhs, int rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( int lhs, const nsRefPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
|
||||
@@ -123,16 +123,6 @@
|
||||
#define NSCAP_FEATURE_USE_BASE
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_CPP_BOOL
|
||||
typedef bool NSCAP_BOOL;
|
||||
#else
|
||||
typedef PRBool NSCAP_BOOL;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
The following three macros (|NSCAP_ADDREF|, |NSCAP_RELEASE|, and |NSCAP_LOG_ASSIGNMENT|)
|
||||
allow external clients the ability to add logging or other interesting debug facilities.
|
||||
@@ -820,19 +810,6 @@ nsCOMPtr
|
||||
return get();
|
||||
}
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
// broken version for IRIX
|
||||
|
||||
nsCOMPtr<T>*
|
||||
get_address() const
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
// below.
|
||||
{
|
||||
return const_cast<nsCOMPtr<T>*>(this);
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
nsCOMPtr<T>*
|
||||
get_address()
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
@@ -849,8 +826,6 @@ nsCOMPtr
|
||||
return this;
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
public:
|
||||
T&
|
||||
operator*() const
|
||||
@@ -1142,19 +1117,6 @@ class nsCOMPtr<nsISupports>
|
||||
return get();
|
||||
}
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
// broken version for IRIX
|
||||
|
||||
nsCOMPtr<nsISupports>*
|
||||
get_address() const
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
// below.
|
||||
{
|
||||
return const_cast<nsCOMPtr<nsISupports>*>(this);
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
nsCOMPtr<nsISupports>*
|
||||
get_address()
|
||||
// This is not intended to be used by clients. See |address_of|
|
||||
@@ -1171,8 +1133,6 @@ class nsCOMPtr<nsISupports>
|
||||
return this;
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
public:
|
||||
|
||||
nsISupports&
|
||||
@@ -1285,20 +1245,6 @@ nsCOMPtr<T>::begin_assignment()
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
// This is the broken version for IRIX, which can't handle the version below.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsCOMPtr<T>*
|
||||
address_of( const nsCOMPtr<T>& aPtr )
|
||||
{
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#else // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsCOMPtr<T>*
|
||||
@@ -1315,8 +1261,6 @@ address_of( const nsCOMPtr<T>& aPtr )
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
#endif // CANT_RESOLVE_CPP_CONST_AMBIGUITY
|
||||
|
||||
template <class T>
|
||||
class nsGetterAddRefs
|
||||
/*
|
||||
@@ -1449,7 +1393,7 @@ CallQueryInterface( T* aSource, nsGetterAddRefs<DestinationType> aDestination )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsCOMPtr<T>& lhs, const nsCOMPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == static_cast<const U*>(rhs.get());
|
||||
@@ -1458,7 +1402,7 @@ operator==( const nsCOMPtr<T>& lhs, const nsCOMPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsCOMPtr<T>& lhs, const nsCOMPtr<U>& rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != static_cast<const U*>(rhs.get());
|
||||
@@ -1469,7 +1413,7 @@ operator!=( const nsCOMPtr<T>& lhs, const nsCOMPtr<U>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsCOMPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == rhs;
|
||||
@@ -1477,7 +1421,7 @@ operator==( const nsCOMPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const U* lhs, const nsCOMPtr<T>& rhs )
|
||||
{
|
||||
return lhs == static_cast<const T*>(rhs.get());
|
||||
@@ -1485,7 +1429,7 @@ operator==( const U* lhs, const nsCOMPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsCOMPtr<T>& lhs, const U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != rhs;
|
||||
@@ -1493,7 +1437,7 @@ operator!=( const nsCOMPtr<T>& lhs, const U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const U* lhs, const nsCOMPtr<T>& rhs )
|
||||
{
|
||||
return lhs != static_cast<const T*>(rhs.get());
|
||||
@@ -1518,7 +1462,7 @@ operator!=( const U* lhs, const nsCOMPtr<T>& rhs )
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsCOMPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) == const_cast<const U*>(rhs);
|
||||
@@ -1526,7 +1470,7 @@ operator==( const nsCOMPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( U* lhs, const nsCOMPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) == static_cast<const T*>(rhs.get());
|
||||
@@ -1534,7 +1478,7 @@ operator==( U* lhs, const nsCOMPtr<T>& rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsCOMPtr<T>& lhs, U* rhs )
|
||||
{
|
||||
return static_cast<const T*>(lhs.get()) != const_cast<const U*>(rhs);
|
||||
@@ -1542,7 +1486,7 @@ operator!=( const nsCOMPtr<T>& lhs, U* rhs )
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( U* lhs, const nsCOMPtr<T>& rhs )
|
||||
{
|
||||
return const_cast<const U*>(lhs) != static_cast<const T*>(rhs.get());
|
||||
@@ -1557,7 +1501,7 @@ class NSCAP_Zero;
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsCOMPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -1566,7 +1510,7 @@ operator==( const nsCOMPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( NSCAP_Zero* lhs, const nsCOMPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
@@ -1575,7 +1519,7 @@ operator==( NSCAP_Zero* lhs, const nsCOMPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( const nsCOMPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
// specifically to allow |smartPtr != 0|
|
||||
{
|
||||
@@ -1584,7 +1528,7 @@ operator!=( const nsCOMPtr<T>& lhs, NSCAP_Zero* rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator!=( NSCAP_Zero* lhs, const nsCOMPtr<T>& rhs )
|
||||
// specifically to allow |0 != smartPtr|
|
||||
{
|
||||
@@ -1599,7 +1543,7 @@ operator!=( NSCAP_Zero* lhs, const nsCOMPtr<T>& rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( const nsCOMPtr<T>& lhs, int rhs )
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
@@ -1608,7 +1552,7 @@ operator==( const nsCOMPtr<T>& lhs, int rhs )
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
operator==( int lhs, const nsCOMPtr<T>& rhs )
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
@@ -1620,7 +1564,7 @@ operator==( int lhs, const nsCOMPtr<T>& rhs )
|
||||
// Comparing any two [XP]COM objects for identity
|
||||
|
||||
inline
|
||||
NSCAP_BOOL
|
||||
bool
|
||||
SameCOMIdentity( nsISupports* lhs, nsISupports* rhs )
|
||||
{
|
||||
return nsCOMPtr<nsISupports>( do_QueryInterface(lhs) ) == nsCOMPtr<nsISupports>( do_QueryInterface(rhs) );
|
||||
|
||||
@@ -77,12 +77,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CPP_BOOL
|
||||
typedef bool nsCharTraits_bool;
|
||||
#else
|
||||
typedef PRBool nsCharTraits_bool;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Some macros for converting PRUnichar (UTF-16) to and from Unicode scalar
|
||||
* values.
|
||||
@@ -184,7 +178,7 @@ struct nsCharTraits<PRUnichar>
|
||||
}
|
||||
|
||||
static
|
||||
nsCharTraits_bool
|
||||
bool
|
||||
eq_int_type( int_type lhs, int_type rhs )
|
||||
{
|
||||
return lhs == rhs;
|
||||
@@ -194,14 +188,14 @@ struct nsCharTraits<PRUnichar>
|
||||
// |char_type| comparisons:
|
||||
|
||||
static
|
||||
nsCharTraits_bool
|
||||
bool
|
||||
eq( char_type lhs, char_type rhs )
|
||||
{
|
||||
return lhs == rhs;
|
||||
}
|
||||
|
||||
static
|
||||
nsCharTraits_bool
|
||||
bool
|
||||
lt( char_type lhs, char_type rhs )
|
||||
{
|
||||
return lhs < rhs;
|
||||
@@ -470,7 +464,7 @@ struct nsCharTraits<char>
|
||||
}
|
||||
|
||||
static
|
||||
nsCharTraits_bool
|
||||
bool
|
||||
eq_int_type( int_type lhs, int_type rhs )
|
||||
{
|
||||
return lhs == rhs;
|
||||
@@ -480,14 +474,14 @@ struct nsCharTraits<char>
|
||||
// |char_type| comparisons:
|
||||
|
||||
static
|
||||
nsCharTraits_bool
|
||||
bool
|
||||
eq( char_type lhs, char_type rhs )
|
||||
{
|
||||
return lhs == rhs;
|
||||
}
|
||||
|
||||
static
|
||||
nsCharTraits_bool
|
||||
bool
|
||||
lt( char_type lhs, char_type rhs )
|
||||
{
|
||||
return lhs < rhs;
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
/* Define if the c++ compiler can resolve ambiguity with |using| */
|
||||
#undef HAVE_CPP_AMBIGUITY_RESOLVING_USING
|
||||
|
||||
/* Define if the c++ compiler has builtin Bool type */
|
||||
#undef HAVE_CPP_BOOL
|
||||
|
||||
/* Define if the c++ compiler supports char16_t */
|
||||
#undef HAVE_CPP_CHAR16_T
|
||||
|
||||
|
||||
Reference in New Issue
Block a user