From f32dd26a1bc2f880b4b52bac241cacadbb5285a7 Mon Sep 17 00:00:00 2001 From: "mkaply%us.ibm.com" Date: Tue, 2 May 2000 22:38:04 +0000 Subject: [PATCH] # 34082 r= dougt@netscape.com OS/2 bring up continues - Adding PR_CALLBACKs for VisualAge Compiler git-svn-id: svn://10.0.0.236/trunk@67931 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/string/obsolete/nsString2.cpp | 18 +++++----- .../xpcom/components/nsComponentManager.cpp | 23 ++++++++---- .../components/nsNativeComponentLoader.cpp | 18 ++++++++-- mozilla/xpcom/components/nsServiceManager.cpp | 3 +- mozilla/xpcom/ds/nsAtomTable.cpp | 3 +- mozilla/xpcom/ds/nsHashtable.cpp | 36 ++++++++++++------- mozilla/xpcom/ds/nsHashtable.h | 14 ++++++-- mozilla/xpcom/ds/nsHashtableEnumerator.cpp | 3 +- mozilla/xpcom/ds/nsObserverService.cpp | 3 +- mozilla/xpcom/ds/nsProperties.cpp | 3 +- mozilla/xpcom/ds/nsProperties.h | 3 +- mozilla/xpcom/ds/nsSizeOfHandler.cpp | 18 +++++++--- mozilla/xpcom/ds/nsString2.cpp | 18 +++++----- mozilla/xpcom/ds/nsVoidArray.h | 3 +- mozilla/xpcom/io/nsUnicharInputStream.cpp | 3 +- mozilla/xpcom/proxy/src/nsProxyEvent.cpp | 19 +++++++--- mozilla/xpcom/string/obsolete/nsString2.cpp | 18 +++++----- mozilla/xpcom/tests/TestAutoLock.cpp | 3 +- mozilla/xpcom/threads/nsThread.h | 16 +++++++-- 19 files changed, 154 insertions(+), 71 deletions(-) diff --git a/mozilla/string/obsolete/nsString2.cpp b/mozilla/string/obsolete/nsString2.cpp index 13692a61a71..b2963731ea6 100644 --- a/mozilla/string/obsolete/nsString2.cpp +++ b/mozilla/string/obsolete/nsString2.cpp @@ -124,18 +124,18 @@ nsString::nsString(const nsString& aString) { * @update gess 1/4/99 * @param reference to a subsumeString */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsString::nsString(const nsSubsumeStr& aSubsumeStr) { Initialize(*this,eTwoByte); - nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsString::nsString(nsSubsumeStr& aSubsumeStr) { Initialize(*this,eTwoByte); Subsume(*this,aSubsumeStr); -#endif /* AIX */ +#endif /* AIX || XP_OS2_VACPP */ } /** @@ -1081,14 +1081,14 @@ nsString& nsString::Assign(PRUnichar aChar) { * @param * @return */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsString& nsString::operator=(const nsSubsumeStr& aSubsumeString) { - nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsString& nsString::operator=(nsSubsumeStr& aSubsumeString) { Subsume(*this,aSubsumeString); -#endif // AIX +#endif // AIX || XP_OS2_VACPP return *this; } #endif @@ -2390,14 +2390,14 @@ nsAutoString::nsAutoString(PRUnichar aChar) : nsString(){ * @update gess 1/4/99 * @param reference to a subsumeString */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsAutoString::nsAutoString(const nsSubsumeStr& aSubsumeStr) :nsString() { - nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsAutoString::nsAutoString( nsSubsumeStr& aSubsumeStr) :nsString() { Subsume(*this,aSubsumeStr); -#endif // AIX +#endif // AIX || XP_OS2_VACPP } /** diff --git a/mozilla/xpcom/components/nsComponentManager.cpp b/mozilla/xpcom/components/nsComponentManager.cpp index a279ebed0ae..81872f57835 100644 --- a/mozilla/xpcom/components/nsComponentManager.cpp +++ b/mozilla/xpcom/components/nsComponentManager.cpp @@ -19,6 +19,17 @@ * * Contributor(s): * Pierre Phaneuf + * + * This Original Code has been modified by IBM Corporation. + * Modifications made by IBM described herein are + * Copyright (c) International Business Machines + * Corporation, 2000 + * + * Modifications to Mozilla code or documentation + * identified per MPL Section 3.3 + * + * Date Modified by Description of modification + * 04/20/2000 IBM Corp. Added PR_CALLBACK for Optlink use in OS2 */ #include @@ -138,10 +149,10 @@ nsCreateInstanceByProgID::operator()( const nsIID& aIID, void** aInstancePtr ) c } /* prototypes for the Mac */ -PRBool +PRBool PR_CALLBACK nsFactoryEntry_Destroy(nsHashKey *aKey, void *aData, void* closure); -PRBool +PRBool PR_CALLBACK nsCID_Destroy(nsHashKey *aKey, void *aData, void* closure); //////////////////////////////////////////////////////////////////////////////// // nsFactoryEntry @@ -1809,7 +1820,7 @@ struct CanUnload_closure { nsIComponentLoader *native; }; -static PRBool +static PRBool PR_CALLBACK CanUnload_enumerate(nsHashKey *key, void *aData, void *aClosure) { nsIComponentLoader *loader = (nsIComponentLoader *)aData; @@ -1893,7 +1904,7 @@ struct AutoReg_closure { PRBool registered; }; -static PRBool +static PRBool PR_CALLBACK AutoRegister_enumerate(nsHashKey *key, void *aData, void *aClosure) { nsIComponentLoader *loader = NS_STATIC_CAST(nsIComponentLoader *, aData); @@ -1910,7 +1921,7 @@ AutoRegister_enumerate(nsHashKey *key, void *aData, void *aClosure) return NS_SUCCEEDED(closure->status) ? PR_TRUE : PR_FALSE; } -static PRBool +static PRBool PR_CALLBACK RegisterDeferred_enumerate(nsHashKey *key, void *aData, void *aClosure) { nsIComponentLoader *loader = NS_STATIC_CAST(nsIComponentLoader *, aData); @@ -2025,7 +2036,7 @@ nsComponentManagerImpl::AutoRegister(PRInt32 when, nsIFile *inDirSpec) return closure.status; } -static PRBool +static PRBool PR_CALLBACK AutoRegisterComponent_enumerate(nsHashKey *key, void *aData, void *aClosure) { PRBool didRegister; diff --git a/mozilla/xpcom/components/nsNativeComponentLoader.cpp b/mozilla/xpcom/components/nsNativeComponentLoader.cpp index b33a430f83c..dd38408efb6 100644 --- a/mozilla/xpcom/components/nsNativeComponentLoader.cpp +++ b/mozilla/xpcom/components/nsNativeComponentLoader.cpp @@ -14,6 +14,18 @@ * Communications Corporation. Portions created by Netscape are * Copyright (C) 1999 Netscape Communications Corporation. All Rights * Reserved. + * + * Contributors: + * This Original Code has been modified by IBM Corporation. + * Modifications made by IBM described herein are + * Copyright (c) International Business Machines + * Corporation, 2000 + * + * Modifications to Mozilla code or documentation + * identified per MPL Section 3.3 + * + * Date Modified by Description of modification + * 04/20/2000 IBM Corp. Added PR_CALLBACK for Optlink use in OS2 */ #include "prmem.h" @@ -51,7 +63,7 @@ nsNativeComponentLoader::nsNativeComponentLoader() : NS_INIT_REFCNT(); } -static PRBool +static PRBool PR_CALLBACK nsDll_Destroy(nsHashKey *aKey, void *aData, void* closure) { nsDll* entry = NS_STATIC_CAST(nsDll*, aData); @@ -289,7 +301,7 @@ nsNativeComponentLoader::RegisterComponentsInDir(PRInt32 when, return rv; } -static nsresult +static nsresult PR_CALLBACK nsFreeLibrary(nsDll *dll, nsIServiceManager *serviceMgr, PRInt32 when) { nsresult rv = NS_ERROR_FAILURE; @@ -388,7 +400,7 @@ struct freeLibrariesClosure PRInt32 when; }; -static PRBool +static PRBool PR_CALLBACK nsFreeLibraryEnum(nsHashKey *aKey, void *aData, void* closure) { nsDll *dll = (nsDll *) aData; diff --git a/mozilla/xpcom/components/nsServiceManager.cpp b/mozilla/xpcom/components/nsServiceManager.cpp index 99c9f88185a..0cc5ccd5d7f 100644 --- a/mozilla/xpcom/components/nsServiceManager.cpp +++ b/mozilla/xpcom/components/nsServiceManager.cpp @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * IBM Corp. */ #include "nsIServiceManager.h" @@ -202,7 +203,7 @@ protected: PRMonitor* mMonitor; }; -static PRBool +static PRBool PR_CALLBACK DeleteEntry(nsHashKey *aKey, void *aData, void* closure) { nsServiceEntry* entry = (nsServiceEntry*)aData; diff --git a/mozilla/xpcom/ds/nsAtomTable.cpp b/mozilla/xpcom/ds/nsAtomTable.cpp index 30c9eb31847..93a8c1197b3 100644 --- a/mozilla/xpcom/ds/nsAtomTable.cpp +++ b/mozilla/xpcom/ds/nsAtomTable.cpp @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * IBM Corp. */ #include "nsAtomTable.h" @@ -33,7 +34,7 @@ static nsrefcnt gAtoms; static struct PLHashTable* gAtomHashTable; #if defined(DEBUG) && (defined(XP_UNIX) || defined(XP_PC)) -static PRIntn +static PRIntn PR_CALLBACK DumpAtomLeaks(PLHashEntry *he, PRIntn index, void *arg) { AtomImpl* atom = (AtomImpl*) he->value; diff --git a/mozilla/xpcom/ds/nsHashtable.cpp b/mozilla/xpcom/ds/nsHashtable.cpp index 7e56eae06ff..951c6e44c10 100644 --- a/mozilla/xpcom/ds/nsHashtable.cpp +++ b/mozilla/xpcom/ds/nsHashtable.cpp @@ -18,6 +18,16 @@ * Rights Reserved. * * Contributor(s): + * This Original Code has been modified by IBM Corporation. + * Modifications made by IBM described herein are + * Copyright (c) International Business Machines + * Corporation, 2000 + * + * Modifications to Mozilla code or documentation + * identified per MPL Section 3.3 + * + * Date Modified by Description of modification + * 04/20/2000 IBM Corp. Added PR_CALLBACK for Optlink use in OS2 */ #include "prmem.h" @@ -28,16 +38,16 @@ // Key operations // -static PR_CALLBACK PLHashNumber _hashValue(const void *key) +static PLHashNumber PR_CALLBACK _hashValue(const void *key) { return ((const nsHashKey *) key)->HashValue(); } -static PR_CALLBACK PRIntn _hashKeyCompare(const void *key1, const void *key2) { +static PRIntn PR_CALLBACK _hashKeyCompare(const void *key1, const void *key2) { return ((const nsHashKey *) key1)->Equals((const nsHashKey *) key2); } -static PR_CALLBACK PRIntn _hashValueCompare(const void *value1, +static PRIntn PR_CALLBACK _hashValueCompare(const void *value1, const void *value2) { // We're not going to make any assumptions about value equality return 0; @@ -47,19 +57,19 @@ static PR_CALLBACK PRIntn _hashValueCompare(const void *value1, // Memory callbacks // -static PR_CALLBACK void *_hashAllocTable(void *pool, PRSize size) { +static void * PR_CALLBACK _hashAllocTable(void *pool, PRSize size) { return PR_MALLOC(size); } -static PR_CALLBACK void _hashFreeTable(void *pool, void *item) { +static void PR_CALLBACK _hashFreeTable(void *pool, void *item) { PR_DELETE(item); } -static PR_CALLBACK PLHashEntry *_hashAllocEntry(void *pool, const void *key) { +static PLHashEntry * PR_CALLBACK _hashAllocEntry(void *pool, const void *key) { return PR_NEW(PLHashEntry); } -static PR_CALLBACK void _hashFreeEntry(void *pool, PLHashEntry *entry, +static void PR_CALLBACK _hashFreeEntry(void *pool, PLHashEntry *entry, PRUintn flag) { if (flag == HT_FREE_ENTRY) { delete (nsHashKey *) (entry->key); @@ -81,7 +91,7 @@ struct _HashEnumerateArgs { void* arg; }; -static PR_CALLBACK PRIntn _hashEnumerate(PLHashEntry *he, PRIntn i, void *arg) +static PRIntn PR_CALLBACK _hashEnumerate(PLHashEntry *he, PRIntn i, void *arg) { _HashEnumerateArgs* thunk = (_HashEnumerateArgs*)arg; return thunk->fn((nsHashKey *) he->key, he->value, thunk->arg) @@ -194,7 +204,7 @@ void *nsHashtable::Remove(nsHashKey *aKey) { // XXX This method was called _hashEnumerateCopy, but it didn't copy the element! // I don't know how this was supposed to work since the elements are neither copied // nor refcounted. -static PR_CALLBACK PRIntn _hashEnumerateShare(PLHashEntry *he, PRIntn i, void *arg) +static PRIntn PR_CALLBACK _hashEnumerateShare(PLHashEntry *he, PRIntn i, void *arg) { nsHashtable *newHashtable = (nsHashtable *)arg; newHashtable->Put((nsHashKey *) he->key, he->value); @@ -218,7 +228,7 @@ void nsHashtable::Enumerate(nsHashtableEnumFunc aEnumFunc, void* closure) { PL_HashTableEnumerateEntries(hashtable, _hashEnumerate, &thunk); } -static PR_CALLBACK PRIntn _hashEnumerateRemove(PLHashEntry *he, PRIntn i, void *arg) +static PRIntn PR_CALLBACK _hashEnumerateRemove(PLHashEntry *he, PRIntn i, void *arg) { _HashEnumerateArgs* thunk = (_HashEnumerateArgs*)arg; if (thunk) @@ -312,7 +322,7 @@ nsObjectHashtable::~nsObjectHashtable() Reset(); } -PR_CALLBACK PRIntn +PRIntn PR_CALLBACK nsObjectHashtable::CopyElement(PLHashEntry *he, PRIntn i, void *arg) { nsObjectHashtable *newHashtable = (nsObjectHashtable *)arg; @@ -361,7 +371,7 @@ nsObjectHashtable::RemoveAndDelete(nsHashKey *aKey) //////////////////////////////////////////////////////////////////////////////// // nsSupportsHashtable: an nsHashtable where the elements are nsISupports* -static PR_CALLBACK PRBool +static PRBool PR_CALLBACK _ReleaseElement(nsHashKey *aKey, void *aData, void* closure) { nsISupports* element = NS_STATIC_CAST(nsISupports*, aData); @@ -404,7 +414,7 @@ nsSupportsHashtable::Remove(nsHashKey *aKey) return data; } -static PR_CALLBACK PRIntn +static PRIntn PR_CALLBACK _hashEnumerateCopy(PLHashEntry *he, PRIntn i, void *arg) { nsHashtable *newHashtable = (nsHashtable *)arg; diff --git a/mozilla/xpcom/ds/nsHashtable.h b/mozilla/xpcom/ds/nsHashtable.h index c2947f27b4e..f40e5f67278 100644 --- a/mozilla/xpcom/ds/nsHashtable.h +++ b/mozilla/xpcom/ds/nsHashtable.h @@ -18,6 +18,16 @@ * Rights Reserved. * * Contributor(s): + * This Original Code has been modified by IBM Corporation. + * Modifications made by IBM described herein are + * Copyright (c) International Business Machines + * Corporation, 2000 + * + * Modifications to Mozilla code or documentation + * identified per MPL Section 3.3 + * + * Date Modified by Description of modification + * 04/20/2000 IBM Corp. Added PR_CALLBACK for Optlink use in OS2 */ #ifndef nsHashtable_h__ @@ -39,7 +49,7 @@ public: // Enumerator callback function. Use -typedef PRBool (*nsHashtableEnumFunc)(nsHashKey *aKey, void *aData, void* closure); +typedef PRBool (* PR_CALLBACK nsHashtableEnumFunc)(nsHashKey *aKey, void *aData, void* closure); class NS_COM nsHashtable { protected: @@ -82,7 +92,7 @@ public: PRBool RemoveAndDelete(nsHashKey *aKey); protected: - static PR_CALLBACK PRIntn CopyElement(PLHashEntry *he, PRIntn i, void *arg); + static PRIntn PR_CALLBACK CopyElement(PLHashEntry *he, PRIntn i, void *arg); nsHashtableCloneElementFunc mCloneElementFun; void* mCloneElementClosure; diff --git a/mozilla/xpcom/ds/nsHashtableEnumerator.cpp b/mozilla/xpcom/ds/nsHashtableEnumerator.cpp index b2686cadf3d..b5271887033 100644 --- a/mozilla/xpcom/ds/nsHashtableEnumerator.cpp +++ b/mozilla/xpcom/ds/nsHashtableEnumerator.cpp @@ -19,6 +19,7 @@ * * Contributor(s): * Pierre Phaneuf + * IBM Corp. */ /* @@ -92,7 +93,7 @@ nsHashtableEnumerator::nsHashtableEnumerator (nsHashtable *aHash, } -PRBool +PRBool PR_CALLBACK hash_enumerator (nsHashKey *aKey, void *aObject, void *closure) { nsresult rv; diff --git a/mozilla/xpcom/ds/nsObserverService.cpp b/mozilla/xpcom/ds/nsObserverService.cpp index 1e42de00322..0ef04db0948 100644 --- a/mozilla/xpcom/ds/nsObserverService.cpp +++ b/mozilla/xpcom/ds/nsObserverService.cpp @@ -19,6 +19,7 @@ * * Contributor(s): * Pierre Phaneuf + * IBM Corp. */ #define NS_IMPL_IDS @@ -91,7 +92,7 @@ nsresult nsObserverService::GetObserverService(nsIObserverService** anObserverSe return NS_OK; } -static PRBool +static PRBool PR_CALLBACK ReleaseObserverList(nsHashKey *aKey, void *aData, void* closure) { nsIObserverList* observerList = NS_STATIC_CAST(nsIObserverList*, aData); diff --git a/mozilla/xpcom/ds/nsProperties.cpp b/mozilla/xpcom/ds/nsProperties.cpp index 0e3ccca6a13..b1551b1d715 100644 --- a/mozilla/xpcom/ds/nsProperties.cpp +++ b/mozilla/xpcom/ds/nsProperties.cpp @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * IBM Corp. */ #define NS_IMPL_IDS @@ -49,7 +50,7 @@ nsProperties::Create(nsISupports *outer, REFNSIID aIID, void **aResult) return rv; } -PRBool +PRBool PR_CALLBACK nsProperties::ReleaseValues(nsHashKey* key, void* data, void* closure) { nsISupports* value = (nsISupports*)data; diff --git a/mozilla/xpcom/ds/nsProperties.h b/mozilla/xpcom/ds/nsProperties.h index d9ce3995aab..7c62741a4f3 100644 --- a/mozilla/xpcom/ds/nsProperties.h +++ b/mozilla/xpcom/ds/nsProperties.h @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * IBM Corp. */ #ifndef nsProperties_h___ @@ -41,7 +42,7 @@ public: static NS_METHOD Create(nsISupports *aOuter, REFNSIID aIID, void **aResult); - static PRBool ReleaseValues(nsHashKey* key, void* data, void* closure); + static PRBool PR_CALLBACK ReleaseValues(nsHashKey* key, void* data, void* closure); }; diff --git a/mozilla/xpcom/ds/nsSizeOfHandler.cpp b/mozilla/xpcom/ds/nsSizeOfHandler.cpp index d69f5a98050..e4eb105c6bd 100644 --- a/mozilla/xpcom/ds/nsSizeOfHandler.cpp +++ b/mozilla/xpcom/ds/nsSizeOfHandler.cpp @@ -18,6 +18,16 @@ * Rights Reserved. * * Contributor(s): + * This Original Code has been modified by IBM Corporation. + * Modifications made by IBM described herein are + * Copyright (c) International Business Machines + * Corporation, 2000 + * + * Modifications to Mozilla code or documentation + * identified per MPL Section 3.3 + * + * Date Modified by Description of modification + * 04/20/2000 IBM Corp. Added PR_CALLBACK for Optlink use in OS2 */ #include "nsISizeOfHandler.h" #include "nsIAtom.h" @@ -33,10 +43,10 @@ public: // nsISizeOfHandler NS_IMETHOD Init(); - NS_IMETHOD RecordObject(void* aObject, PRBool* aResult); - NS_IMETHOD AddSize(nsIAtom* aKey, PRUint32 aSize); - NS_IMETHOD Report(nsISizeofReportFunc aFunc, void* aArg); - NS_IMETHOD GetTotals(PRUint32* aCountResult, PRUint32* aTotalSizeResult); + NS_IMETHOD PR_CALLBACK RecordObject(void* aObject, PRBool* aResult); + NS_IMETHOD PR_CALLBACK AddSize(nsIAtom* aKey, PRUint32 aSize); + NS_IMETHOD PR_CALLBACK Report(nsISizeofReportFunc aFunc, void* aArg); + NS_IMETHOD PR_CALLBACK GetTotals(PRUint32* aCountResult, PRUint32* aTotalSizeResult); protected: PRUint32 mTotalSize; diff --git a/mozilla/xpcom/ds/nsString2.cpp b/mozilla/xpcom/ds/nsString2.cpp index 13692a61a71..b2963731ea6 100644 --- a/mozilla/xpcom/ds/nsString2.cpp +++ b/mozilla/xpcom/ds/nsString2.cpp @@ -124,18 +124,18 @@ nsString::nsString(const nsString& aString) { * @update gess 1/4/99 * @param reference to a subsumeString */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsString::nsString(const nsSubsumeStr& aSubsumeStr) { Initialize(*this,eTwoByte); - nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsString::nsString(nsSubsumeStr& aSubsumeStr) { Initialize(*this,eTwoByte); Subsume(*this,aSubsumeStr); -#endif /* AIX */ +#endif /* AIX || XP_OS2_VACPP */ } /** @@ -1081,14 +1081,14 @@ nsString& nsString::Assign(PRUnichar aChar) { * @param * @return */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsString& nsString::operator=(const nsSubsumeStr& aSubsumeString) { - nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsString& nsString::operator=(nsSubsumeStr& aSubsumeString) { Subsume(*this,aSubsumeString); -#endif // AIX +#endif // AIX || XP_OS2_VACPP return *this; } #endif @@ -2390,14 +2390,14 @@ nsAutoString::nsAutoString(PRUnichar aChar) : nsString(){ * @update gess 1/4/99 * @param reference to a subsumeString */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsAutoString::nsAutoString(const nsSubsumeStr& aSubsumeStr) :nsString() { - nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsAutoString::nsAutoString( nsSubsumeStr& aSubsumeStr) :nsString() { Subsume(*this,aSubsumeStr); -#endif // AIX +#endif // AIX || XP_OS2_VACPP } /** diff --git a/mozilla/xpcom/ds/nsVoidArray.h b/mozilla/xpcom/ds/nsVoidArray.h index dae7fe0b758..0dd9f7a36b4 100644 --- a/mozilla/xpcom/ds/nsVoidArray.h +++ b/mozilla/xpcom/ds/nsVoidArray.h @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * IBM Corp. */ #ifndef nsVoidArray_h___ #define nsVoidArray_h___ @@ -26,7 +27,7 @@ class nsISizeOfHandler; // Enumerator callback function. Return PR_FALSE to stop -typedef PRBool (*nsVoidArrayEnumFunc)(void* aElement, void *aData); +typedef PRBool (* PR_CALLBACK nsVoidArrayEnumFunc)(void* aElement, void *aData); /// A basic zero-based array of void*'s that manages its own memory class NS_COM nsVoidArray { diff --git a/mozilla/xpcom/io/nsUnicharInputStream.cpp b/mozilla/xpcom/io/nsUnicharInputStream.cpp index c721fec8ba4..18af0f36d00 100644 --- a/mozilla/xpcom/io/nsUnicharInputStream.cpp +++ b/mozilla/xpcom/io/nsUnicharInputStream.cpp @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * IBM Corp. */ #define NS_IMPL_IDS @@ -30,7 +31,7 @@ #include "nsString.h" #include "nsCRT.h" #include -#ifdef NS_WIN32 +#if defined(NS_WIN32) || defined(XP_OS2_VACPP) #include #else #include diff --git a/mozilla/xpcom/proxy/src/nsProxyEvent.cpp b/mozilla/xpcom/proxy/src/nsProxyEvent.cpp index 1f192dbf98a..e4617e5c3b3 100644 --- a/mozilla/xpcom/proxy/src/nsProxyEvent.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyEvent.cpp @@ -19,6 +19,17 @@ * * Contributor(s): * Pierre Phaneuf + * + * This Original Code has been modified by IBM Corporation. + * Modifications made by IBM described herein are + * Copyright (c) International Business Machines + * Corporation, 2000 + * + * Modifications to Mozilla code or documentation + * identified per MPL Section 3.3 + * + * Date Modified by Description of modification + * 04/20/2000 IBM Corp. Added PR_CALLBACK for Optlink use in OS2 */ @@ -42,10 +53,10 @@ static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -static void* EventHandler(PLEvent *self); -static void DestroyHandler(PLEvent *self); -static void* CompletedEventHandler(PLEvent *self); -static void CompletedDestroyHandler(PLEvent *self) ; +static void* PR_CALLBACK EventHandler(PLEvent *self); +static void PR_CALLBACK DestroyHandler(PLEvent *self); +static void* PR_CALLBACK CompletedEventHandler(PLEvent *self); +static void PR_CALLBACK CompletedDestroyHandler(PLEvent *self) ; nsProxyObjectCallInfo::nsProxyObjectCallInfo( nsProxyObject* owner, nsXPTMethodInfo *methodInfo, diff --git a/mozilla/xpcom/string/obsolete/nsString2.cpp b/mozilla/xpcom/string/obsolete/nsString2.cpp index 13692a61a71..b2963731ea6 100644 --- a/mozilla/xpcom/string/obsolete/nsString2.cpp +++ b/mozilla/xpcom/string/obsolete/nsString2.cpp @@ -124,18 +124,18 @@ nsString::nsString(const nsString& aString) { * @update gess 1/4/99 * @param reference to a subsumeString */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsString::nsString(const nsSubsumeStr& aSubsumeStr) { Initialize(*this,eTwoByte); - nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsString::nsString(nsSubsumeStr& aSubsumeStr) { Initialize(*this,eTwoByte); Subsume(*this,aSubsumeStr); -#endif /* AIX */ +#endif /* AIX || XP_OS2_VACPP */ } /** @@ -1081,14 +1081,14 @@ nsString& nsString::Assign(PRUnichar aChar) { * @param * @return */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsString& nsString::operator=(const nsSubsumeStr& aSubsumeString) { - nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeString); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsString& nsString::operator=(nsSubsumeStr& aSubsumeString) { Subsume(*this,aSubsumeString); -#endif // AIX +#endif // AIX || XP_OS2_VACPP return *this; } #endif @@ -2390,14 +2390,14 @@ nsAutoString::nsAutoString(PRUnichar aChar) : nsString(){ * @update gess 1/4/99 * @param reference to a subsumeString */ -#ifdef AIX +#if defined(AIX) || defined(XP_OS2_VACPP) nsAutoString::nsAutoString(const nsSubsumeStr& aSubsumeStr) :nsString() { - nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX compiler + nsSubsumeStr temp(aSubsumeStr); // a temp is needed for the AIX and VAC++ compilers Subsume(*this,temp); #else nsAutoString::nsAutoString( nsSubsumeStr& aSubsumeStr) :nsString() { Subsume(*this,aSubsumeStr); -#endif // AIX +#endif // AIX || XP_OS2_VACPP } /** diff --git a/mozilla/xpcom/tests/TestAutoLock.cpp b/mozilla/xpcom/tests/TestAutoLock.cpp index bc5cbca1c86..9072791e854 100644 --- a/mozilla/xpcom/tests/TestAutoLock.cpp +++ b/mozilla/xpcom/tests/TestAutoLock.cpp @@ -18,6 +18,7 @@ * Rights Reserved. * * Contributor(s): + * IBM Corp. */ /* @@ -32,7 +33,7 @@ PRLock* gLock; int gCount; -static void run(void* arg) +static void PR_CALLBACK run(void* arg) { for (int i = 0; i < 1000000; ++i) { nsAutoLock guard(gLock); diff --git a/mozilla/xpcom/threads/nsThread.h b/mozilla/xpcom/threads/nsThread.h index d99472aed84..bdfa536e8c1 100644 --- a/mozilla/xpcom/threads/nsThread.h +++ b/mozilla/xpcom/threads/nsThread.h @@ -18,6 +18,16 @@ * Rights Reserved. * * Contributor(s): + * This Original Code has been modified by IBM Corporation. + * Modifications made by IBM described herein are + * Copyright (c) International Business Machines + * Corporation, 2000 + * + * Modifications to Mozilla code or documentation + * identified per MPL Section 3.3 + * + * Date Modified by Description of modification + * 04/20/2000 IBM Corp. Added PR_CALLBACK for Optlink use in OS2 */ #ifndef nsThread_h__ @@ -45,9 +55,9 @@ public: nsresult RegisterThreadSelf(); void SetPRThread(PRThread* thread) { mThread = thread; } - static void Main(void* arg); - static void Exit(void* arg); - static void Shutdown(); + static void PR_CALLBACK Main(void* arg); + static void PR_CALLBACK Exit(void* arg); + static void PR_CALLBACK Shutdown(); static PRUintn kIThreadSelfIndex;