Revert changes. They're causing problems elsewhere.

This commit is contained in:
waterson%netscape.com 2000-04-27 07:01:58 +00:00
Родитель 6e69e7eee7
Коммит 360dc75555
3 изменённых файлов: 72 добавлений и 11 удалений

Просмотреть файл

@ -202,15 +202,6 @@ typedef PRUint16 PRUnichar;
#define HAVE_CPP_NAMESPACE_STD
#define HAVE_CPP_UNAMBIGUOUS_STD_NOTEQUAL
// Other platforms declare standard implementations for operators
// !=, >, >=, and <= based on == and <. VC++ chooses to put these in
// a special namespace. We'll make it seem like they're *not* in a
// special namespace.
#ifdef __cplusplus__
namespace std { namespace rel_ops {} }
using namespace std::rel_ops;
#endif
/* VC++ is special and doesn't use naked min() and max() */
#undef NS_MIN
#define NS_MIN std::_cpp_min

Просмотреть файл

@ -23,7 +23,6 @@
#ifndef nsInt64_h__
#define nsInt64_h__
#include <algorithm> // to get all comparisons given operator== and operator<
#include "prlong.h"
#include "nscore.h"
@ -178,7 +177,11 @@ public:
// Comparison operators
friend inline PRBool operator ==(const nsInt64& aObject1, const nsInt64& aObject2);
friend inline PRBool operator !=(const nsInt64& aObject1, const nsInt64& aObject2);
friend inline PRBool operator >(const nsInt64& aObject1, const nsInt64& aObject2);
friend inline PRBool operator >=(const nsInt64& aObject1, const nsInt64& aObject2);
friend inline PRBool operator <(const nsInt64& aObject1, const nsInt64& aObject2);
friend inline PRBool operator <=(const nsInt64& aObject1, const nsInt64& aObject2);
// Bitwise operators
@ -265,6 +268,30 @@ operator ==(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_EQ(aObject1.mValue, aObject2.mValue);
}
/**
* Determine if two 64-bit integers are not equal
*/
inline PRBool
operator !=(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_NE(aObject1.mValue, aObject2.mValue);
}
/**
* Determine if one 64-bit integer is strictly greater than another, using signed values
*/
inline PRBool
operator >(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_CMP(aObject1.mValue, >, aObject2.mValue);
}
/**
* Determine if one 64-bit integer is greater than or equal to another, using signed values
*/
inline PRBool
operator >=(const nsInt64& aObject1, const nsInt64& aObject2) {
return ! LL_CMP(aObject1.mValue, <, aObject2.mValue);
}
/**
* Determine if one 64-bit integer is strictly less than another, using signed values
*/
@ -273,6 +300,14 @@ operator <(const nsInt64& aObject1, const nsInt64& aObject2) {
return LL_CMP(aObject1.mValue, <, aObject2.mValue);
}
/**
* Determine if one 64-bit integers is less than or equal to another, using signed values
*/
inline PRBool
operator <=(const nsInt64& aObject1, const nsInt64& aObject2) {
return ! LL_CMP(aObject1.mValue, >, aObject2.mValue);
}
/**
* Perform a bitwise AND of two 64-bit integers
*/

Просмотреть файл

@ -23,7 +23,6 @@
#ifndef nsTime_h__
#define nsTime_h__
#include <algorithm> // to get all comparisons given operator== and operator<
#include "prtime.h"
#include "nsInt64.h"
#include "nscore.h"
@ -116,7 +115,11 @@ public:
// Comparison operators
friend const PRBool operator ==(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator !=(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator <(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator <=(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator >(const nsTime& aTime1, const nsTime& aTime2);
friend const PRBool operator >=(const nsTime& aTime1, const nsTime& aTime2);
};
/**
@ -151,6 +154,14 @@ operator ==(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue == aTime2.mValue;
}
/**
* Determine if two times are different
*/
inline const PRBool
operator !=(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue != aTime2.mValue;
}
/**
* Determine if one time is strictly less than another
*/
@ -159,4 +170,28 @@ operator <(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue < aTime2.mValue;
}
/**
* Determine if one time is less than or equal to another
*/
inline const PRBool
operator <=(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue <= aTime2.mValue;
}
/**
* Determine if one time is strictly greater than another
*/
inline const PRBool
operator >(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue > aTime2.mValue;
}
/**
* Determine if one time is greater than or equal to another
*/
inline const PRBool
operator >=(const nsTime& aTime1, const nsTime& aTime2) {
return aTime1.mValue >= aTime2.mValue;
}
#endif // nsTime_h__