From bb796c096f7a2450ab9e645ae605cb4b8d2251d0 Mon Sep 17 00:00:00 2001 From: "scc%mozilla.org" Date: Sun, 11 Jun 2000 04:35:02 +0000 Subject: [PATCH] added some #ifdef logic to allow me to turn NEW_STRING_APIS off, so I can continue to profile for bloat; added an implementation specific |operator+()| to resolve ambiguity with promises on some platforms git-svn-id: svn://10.0.0.236/trunk@71988 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsString.h | 14 ++++++++++++++ mozilla/xpcom/ds/nsString.h | 14 ++++++++++++++ mozilla/xpcom/string/obsolete/nsString.h | 14 ++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/mozilla/string/obsolete/nsString.h b/mozilla/string/obsolete/nsString.h index 9a616fbe741..61169ff2833 100644 --- a/mozilla/string/obsolete/nsString.h +++ b/mozilla/string/obsolete/nsString.h @@ -42,6 +42,11 @@ #define NEW_STRING_APIS 1 #endif //NEW_STRING_APIS + // Need this to enable comparison profiling for a while +#ifdef OLD_STRING_APIS + #undef NEW_STRING_APIS +#endif + #ifndef _nsCString_ #define _nsCString_ @@ -796,6 +801,15 @@ private: void InsertWithConversion( char, PRUint32 ); }; +#ifdef NEW_STRING_APIS +inline +nsPromiseConcatenation +operator+( const nsPromiseConcatenation& lhs, const nsCString& rhs ) + { + return nsPromiseConcatenation(lhs, rhs); + } +#endif + #ifdef NEW_STRING_APIS NS_DEF_STRING_COMPARISON_OPERATORS(nsCString, char) NS_DEF_DERIVED_STRING_OPERATOR_PLUS(nsCString, char); diff --git a/mozilla/xpcom/ds/nsString.h b/mozilla/xpcom/ds/nsString.h index 9a616fbe741..61169ff2833 100644 --- a/mozilla/xpcom/ds/nsString.h +++ b/mozilla/xpcom/ds/nsString.h @@ -42,6 +42,11 @@ #define NEW_STRING_APIS 1 #endif //NEW_STRING_APIS + // Need this to enable comparison profiling for a while +#ifdef OLD_STRING_APIS + #undef NEW_STRING_APIS +#endif + #ifndef _nsCString_ #define _nsCString_ @@ -796,6 +801,15 @@ private: void InsertWithConversion( char, PRUint32 ); }; +#ifdef NEW_STRING_APIS +inline +nsPromiseConcatenation +operator+( const nsPromiseConcatenation& lhs, const nsCString& rhs ) + { + return nsPromiseConcatenation(lhs, rhs); + } +#endif + #ifdef NEW_STRING_APIS NS_DEF_STRING_COMPARISON_OPERATORS(nsCString, char) NS_DEF_DERIVED_STRING_OPERATOR_PLUS(nsCString, char); diff --git a/mozilla/xpcom/string/obsolete/nsString.h b/mozilla/xpcom/string/obsolete/nsString.h index 9a616fbe741..61169ff2833 100644 --- a/mozilla/xpcom/string/obsolete/nsString.h +++ b/mozilla/xpcom/string/obsolete/nsString.h @@ -42,6 +42,11 @@ #define NEW_STRING_APIS 1 #endif //NEW_STRING_APIS + // Need this to enable comparison profiling for a while +#ifdef OLD_STRING_APIS + #undef NEW_STRING_APIS +#endif + #ifndef _nsCString_ #define _nsCString_ @@ -796,6 +801,15 @@ private: void InsertWithConversion( char, PRUint32 ); }; +#ifdef NEW_STRING_APIS +inline +nsPromiseConcatenation +operator+( const nsPromiseConcatenation& lhs, const nsCString& rhs ) + { + return nsPromiseConcatenation(lhs, rhs); + } +#endif + #ifdef NEW_STRING_APIS NS_DEF_STRING_COMPARISON_OPERATORS(nsCString, char) NS_DEF_DERIVED_STRING_OPERATOR_PLUS(nsCString, char);