diff --git a/mozilla/xpcom/base/nsDebug.cpp b/mozilla/xpcom/base/nsDebug.cpp index 82354d59c4a..060d4656797 100644 --- a/mozilla/xpcom/base/nsDebug.cpp +++ b/mozilla/xpcom/base/nsDebug.cpp @@ -18,6 +18,13 @@ * 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/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2 */ #include "nsDebug.h" @@ -36,11 +43,34 @@ #include #endif -#if defined(XP_UNIX) || defined(_WIN32) +#if defined(XP_UNIX) || defined(_WIN32) || defined(XP_OS2) /* for abort() and getenv() */ #include #endif +#if defined(XP_OS2) && defined(DEBUG) +/* Added definitions for DebugBreak() for 2 different OS/2 compilers. Doing + * the int3 on purpose for Visual Age so that a developer can step over the + * instruction if so desired. Not always possible if trapping due to exception + * handling IBM-AKR + */ +#define INCL_WINDIALOGS // need for WinMessageBox +#include + +#if defined(XP_OS2_VACPP) + #include + #define DebugBreak() { _interrupt(3); } +#elif defined(XP_OS2_EMX) + /* Force a trap */ + #define DebugBreak() { int *pTrap=NULL; *pTrap = 1; } +#else + #define DebugBreak() +#endif + +#elif defined(XP_OS2) + #define DebugBreak() +#endif /* XP_OS2 && DEBUG */ + #if defined(_WIN32) #include #include @@ -188,6 +218,27 @@ NS_COM void nsDebug::Assertion(const char* aStr, const char* aExpr, } #endif +#if defined(XP_OS2) + char msg[1200]; + PR_snprintf(msg, sizeof(msg), + "%s\n\nClick Retry to Debug Application.\n" + "Click Cancel to continue running the Application.", buf); + ULONG code = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, msg, + "nsDebug::Assertion", 0, + MB_ERROR | MB_RETRYCANCEL); + + /* It is possible that we are executing on a thread that doesn't have a + * message queue. In that case, the message won't appear, and code will + * be 0xFFFF. We'll give the user a chance to debug it by calling + * Break() + */ + if( code == MBID_CANCEL ) + { + return; + // If Retry, Fall Through + } +#endif + Break(aFile, aLine); } @@ -266,6 +317,8 @@ NS_COM void nsDebug::Abort(const char* aFile, PRIntn aLine) ExitToShell(); #elif defined(XP_UNIX) PR_Abort(); +#elif defined(XP_OS2) + DebugBreak(); #elif defined(XP_BEOS) { #ifndef DEBUG_cls diff --git a/mozilla/xpcom/components/nsCategoryManager.cpp b/mozilla/xpcom/components/nsCategoryManager.cpp index 8731be60b40..f156e77399d 100644 --- a/mozilla/xpcom/components/nsCategoryManager.cpp +++ b/mozilla/xpcom/components/nsCategoryManager.cpp @@ -92,7 +92,8 @@ class CategoryNode { public: CategoryNode() - : nsObjectHashtable(0, 0, Destroy_LeafNode, 0) + : nsObjectHashtable((nsHashtableCloneElementFunc) 0, 0, + (nsHashtableEnumFunc) Destroy_LeafNode, 0 ) { // Nothing else to do here... } @@ -156,7 +157,9 @@ class nsCategoryManager NS_IMPL_ISUPPORTS1(nsCategoryManager, nsICategoryManager) nsCategoryManager::nsCategoryManager() - : nsObjectHashtable(0, 0, Destroy_CategoryNode, 0) + : nsObjectHashtable((nsHashtableCloneElementFunc) 0, 0, + (nsHashtableEnumFunc) Destroy_CategoryNode, 0 ) + { NS_INIT_REFCNT(); } diff --git a/mozilla/xpcom/glue/nsDebug.cpp b/mozilla/xpcom/glue/nsDebug.cpp index 82354d59c4a..060d4656797 100644 --- a/mozilla/xpcom/glue/nsDebug.cpp +++ b/mozilla/xpcom/glue/nsDebug.cpp @@ -18,6 +18,13 @@ * 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/10/2000 IBM Corp. Added DebugBreak() definitions for OS/2 */ #include "nsDebug.h" @@ -36,11 +43,34 @@ #include #endif -#if defined(XP_UNIX) || defined(_WIN32) +#if defined(XP_UNIX) || defined(_WIN32) || defined(XP_OS2) /* for abort() and getenv() */ #include #endif +#if defined(XP_OS2) && defined(DEBUG) +/* Added definitions for DebugBreak() for 2 different OS/2 compilers. Doing + * the int3 on purpose for Visual Age so that a developer can step over the + * instruction if so desired. Not always possible if trapping due to exception + * handling IBM-AKR + */ +#define INCL_WINDIALOGS // need for WinMessageBox +#include + +#if defined(XP_OS2_VACPP) + #include + #define DebugBreak() { _interrupt(3); } +#elif defined(XP_OS2_EMX) + /* Force a trap */ + #define DebugBreak() { int *pTrap=NULL; *pTrap = 1; } +#else + #define DebugBreak() +#endif + +#elif defined(XP_OS2) + #define DebugBreak() +#endif /* XP_OS2 && DEBUG */ + #if defined(_WIN32) #include #include @@ -188,6 +218,27 @@ NS_COM void nsDebug::Assertion(const char* aStr, const char* aExpr, } #endif +#if defined(XP_OS2) + char msg[1200]; + PR_snprintf(msg, sizeof(msg), + "%s\n\nClick Retry to Debug Application.\n" + "Click Cancel to continue running the Application.", buf); + ULONG code = WinMessageBox(HWND_DESKTOP, HWND_DESKTOP, msg, + "nsDebug::Assertion", 0, + MB_ERROR | MB_RETRYCANCEL); + + /* It is possible that we are executing on a thread that doesn't have a + * message queue. In that case, the message won't appear, and code will + * be 0xFFFF. We'll give the user a chance to debug it by calling + * Break() + */ + if( code == MBID_CANCEL ) + { + return; + // If Retry, Fall Through + } +#endif + Break(aFile, aLine); } @@ -266,6 +317,8 @@ NS_COM void nsDebug::Abort(const char* aFile, PRIntn aLine) ExitToShell(); #elif defined(XP_UNIX) PR_Abort(); +#elif defined(XP_OS2) + DebugBreak(); #elif defined(XP_BEOS) { #ifndef DEBUG_cls diff --git a/mozilla/xpcom/io/nsDirectoryService.h b/mozilla/xpcom/io/nsDirectoryService.h index e5f25925627..0d150a8d833 100644 --- a/mozilla/xpcom/io/nsDirectoryService.h +++ b/mozilla/xpcom/io/nsDirectoryService.h @@ -52,7 +52,7 @@ class nsDirectoryService : public nsIDirectoryService, public nsIProperties, pub private: static nsDirectoryService* mService; - static PRBool ReleaseValues(nsHashKey* key, void* data, void* closure); + static PRBool PR_CALLBACK ReleaseValues(nsHashKey* key, void* data, void* closure); nsHashtable* mHashtable; nsCOMPtr mProviders; diff --git a/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp b/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp index ff97a6fe59a..9c7bbc373ee 100644 --- a/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp +++ b/mozilla/xpcom/proxy/src/nsProxyObjectManager.cpp @@ -109,7 +109,7 @@ nsProxyObjectManager::~nsProxyObjectManager() { if (mProxyClassMap) { - mProxyClassMap->Reset(PurgeProxyClasses, nsnull); + mProxyClassMap->Reset((nsHashtableEnumFunc)PurgeProxyClasses, nsnull); delete mProxyClassMap; } delete mProxyObjectMap;