From 92ce1bb48a225b4342774bdc8eef237c24c35c22 Mon Sep 17 00:00:00 2001 From: "jdunn%netscape.com" Date: Fri, 4 Jun 1999 22:08:19 +0000 Subject: [PATCH] AIX requires nsSubsumeStr to be a const... so for AIX (only) lets make it so --- string/obsolete/nsString2.cpp | 13 +++++++++++++ string/obsolete/nsString2.h | 8 ++++++++ xpcom/ds/nsString2.cpp | 13 +++++++++++++ xpcom/ds/nsString2.h | 8 ++++++++ xpcom/string/obsolete/nsString2.cpp | 13 +++++++++++++ xpcom/string/obsolete/nsString2.h | 8 ++++++++ 6 files changed, 63 insertions(+) diff --git a/string/obsolete/nsString2.cpp b/string/obsolete/nsString2.cpp index c757437f6fc0..925d9825e941 100644 --- a/string/obsolete/nsString2.cpp +++ b/string/obsolete/nsString2.cpp @@ -800,8 +800,14 @@ nsString2& nsString2::Assign(PRUnichar aChar) { * @param * @return */ +#ifdef AIX +nsString2& nsString2::operator=(const nsSubsumeStr& aSubsumeString) { + nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX compiler + Subsume(*this,temp); +#else nsString2& nsString2::operator=(nsSubsumeStr& aSubsumeString) { Subsume(*this,aSubsumeString); +#endif // AIX return *this; } @@ -1906,9 +1912,16 @@ nsAutoString2::nsAutoString2(PRUnichar aChar,eCharSize aCharSize) : nsString2(aC * @update gess 1/4/99 * @param reference to a subsumeString */ +#ifdef AIX +nsAutoString2::nsAutoString2(const nsSubsumeStr& aSubsumeStr) :nsString2(aSubsumeStr.mCharSize) { + mAgent=0; + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + Subsume(*this,temp); +#else nsAutoString2::nsAutoString2( nsSubsumeStr& aSubsumeStr) :nsString2(aSubsumeStr.mCharSize) { mAgent=0; Subsume(*this,aSubsumeStr); +#endif // AIX } /** diff --git a/string/obsolete/nsString2.h b/string/obsolete/nsString2.h index a1fe3bf894f9..3a492d667dd9 100644 --- a/string/obsolete/nsString2.h +++ b/string/obsolete/nsString2.h @@ -410,7 +410,11 @@ nsString2& operator=(char aChar) {return Assign(aChar);} nsString2& operator=(PRUnichar aChar) {return Assign(aChar);} nsString2& operator=(const char* aCString) {return Assign(aCString);} nsString2& operator=(const PRUnichar* aString) {return Assign(aString);} +#ifdef AIX +nsString2& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here +#else nsString2& operator=(nsSubsumeStr& aSubsumeString); +#endif /** * Here's a bunch of append mehtods for varying types... @@ -749,7 +753,11 @@ public: nsAutoString2(const nsStr& aString,eCharSize aCharSize=kDefaultCharSize); nsAutoString2(const nsString2& aString,eCharSize aCharSize=kDefaultCharSize); nsAutoString2(const nsAutoString2& aString,eCharSize aCharSize=kDefaultCharSize); +#ifdef AIX + nsAutoString2(const nsSubsumeStr& aSubsumeStr); // AIX requires a const +#else nsAutoString2(nsSubsumeStr& aSubsumeStr); +#endif // AIX nsAutoString2(PRUnichar aChar,eCharSize aCharSize=kDefaultCharSize); virtual ~nsAutoString2(); diff --git a/xpcom/ds/nsString2.cpp b/xpcom/ds/nsString2.cpp index c757437f6fc0..925d9825e941 100644 --- a/xpcom/ds/nsString2.cpp +++ b/xpcom/ds/nsString2.cpp @@ -800,8 +800,14 @@ nsString2& nsString2::Assign(PRUnichar aChar) { * @param * @return */ +#ifdef AIX +nsString2& nsString2::operator=(const nsSubsumeStr& aSubsumeString) { + nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX compiler + Subsume(*this,temp); +#else nsString2& nsString2::operator=(nsSubsumeStr& aSubsumeString) { Subsume(*this,aSubsumeString); +#endif // AIX return *this; } @@ -1906,9 +1912,16 @@ nsAutoString2::nsAutoString2(PRUnichar aChar,eCharSize aCharSize) : nsString2(aC * @update gess 1/4/99 * @param reference to a subsumeString */ +#ifdef AIX +nsAutoString2::nsAutoString2(const nsSubsumeStr& aSubsumeStr) :nsString2(aSubsumeStr.mCharSize) { + mAgent=0; + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + Subsume(*this,temp); +#else nsAutoString2::nsAutoString2( nsSubsumeStr& aSubsumeStr) :nsString2(aSubsumeStr.mCharSize) { mAgent=0; Subsume(*this,aSubsumeStr); +#endif // AIX } /** diff --git a/xpcom/ds/nsString2.h b/xpcom/ds/nsString2.h index a1fe3bf894f9..3a492d667dd9 100644 --- a/xpcom/ds/nsString2.h +++ b/xpcom/ds/nsString2.h @@ -410,7 +410,11 @@ nsString2& operator=(char aChar) {return Assign(aChar);} nsString2& operator=(PRUnichar aChar) {return Assign(aChar);} nsString2& operator=(const char* aCString) {return Assign(aCString);} nsString2& operator=(const PRUnichar* aString) {return Assign(aString);} +#ifdef AIX +nsString2& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here +#else nsString2& operator=(nsSubsumeStr& aSubsumeString); +#endif /** * Here's a bunch of append mehtods for varying types... @@ -749,7 +753,11 @@ public: nsAutoString2(const nsStr& aString,eCharSize aCharSize=kDefaultCharSize); nsAutoString2(const nsString2& aString,eCharSize aCharSize=kDefaultCharSize); nsAutoString2(const nsAutoString2& aString,eCharSize aCharSize=kDefaultCharSize); +#ifdef AIX + nsAutoString2(const nsSubsumeStr& aSubsumeStr); // AIX requires a const +#else nsAutoString2(nsSubsumeStr& aSubsumeStr); +#endif // AIX nsAutoString2(PRUnichar aChar,eCharSize aCharSize=kDefaultCharSize); virtual ~nsAutoString2(); diff --git a/xpcom/string/obsolete/nsString2.cpp b/xpcom/string/obsolete/nsString2.cpp index c757437f6fc0..925d9825e941 100644 --- a/xpcom/string/obsolete/nsString2.cpp +++ b/xpcom/string/obsolete/nsString2.cpp @@ -800,8 +800,14 @@ nsString2& nsString2::Assign(PRUnichar aChar) { * @param * @return */ +#ifdef AIX +nsString2& nsString2::operator=(const nsSubsumeStr& aSubsumeString) { + nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX compiler + Subsume(*this,temp); +#else nsString2& nsString2::operator=(nsSubsumeStr& aSubsumeString) { Subsume(*this,aSubsumeString); +#endif // AIX return *this; } @@ -1906,9 +1912,16 @@ nsAutoString2::nsAutoString2(PRUnichar aChar,eCharSize aCharSize) : nsString2(aC * @update gess 1/4/99 * @param reference to a subsumeString */ +#ifdef AIX +nsAutoString2::nsAutoString2(const nsSubsumeStr& aSubsumeStr) :nsString2(aSubsumeStr.mCharSize) { + mAgent=0; + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + Subsume(*this,temp); +#else nsAutoString2::nsAutoString2( nsSubsumeStr& aSubsumeStr) :nsString2(aSubsumeStr.mCharSize) { mAgent=0; Subsume(*this,aSubsumeStr); +#endif // AIX } /** diff --git a/xpcom/string/obsolete/nsString2.h b/xpcom/string/obsolete/nsString2.h index a1fe3bf894f9..3a492d667dd9 100644 --- a/xpcom/string/obsolete/nsString2.h +++ b/xpcom/string/obsolete/nsString2.h @@ -410,7 +410,11 @@ nsString2& operator=(char aChar) {return Assign(aChar);} nsString2& operator=(PRUnichar aChar) {return Assign(aChar);} nsString2& operator=(const char* aCString) {return Assign(aCString);} nsString2& operator=(const PRUnichar* aString) {return Assign(aString);} +#ifdef AIX +nsString2& operator=(const nsSubsumeStr& aSubsumeString); // AIX requires a const here +#else nsString2& operator=(nsSubsumeStr& aSubsumeString); +#endif /** * Here's a bunch of append mehtods for varying types... @@ -749,7 +753,11 @@ public: nsAutoString2(const nsStr& aString,eCharSize aCharSize=kDefaultCharSize); nsAutoString2(const nsString2& aString,eCharSize aCharSize=kDefaultCharSize); nsAutoString2(const nsAutoString2& aString,eCharSize aCharSize=kDefaultCharSize); +#ifdef AIX + nsAutoString2(const nsSubsumeStr& aSubsumeStr); // AIX requires a const +#else nsAutoString2(nsSubsumeStr& aSubsumeStr); +#endif // AIX nsAutoString2(PRUnichar aChar,eCharSize aCharSize=kDefaultCharSize); virtual ~nsAutoString2();