diff --git a/mozilla/content/html/document/src/nsHTMLDocument.cpp b/mozilla/content/html/document/src/nsHTMLDocument.cpp index 5f890f4963c..c433fcce347 100644 --- a/mozilla/content/html/document/src/nsHTMLDocument.cpp +++ b/mozilla/content/html/document/src/nsHTMLDocument.cpp @@ -36,9 +36,7 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsICharsetAlias.h" -#undef NS_IMPL_IDS #include "nsCOMPtr.h" #include "nsIFileChannel.h" diff --git a/mozilla/editor/txmgr/tests/TestTXMgr.cpp b/mozilla/editor/txmgr/tests/TestTXMgr.cpp index 5536fd13cf1..3feaf05216e 100644 --- a/mozilla/editor/txmgr/tests/TestTXMgr.cpp +++ b/mozilla/editor/txmgr/tests/TestTXMgr.cpp @@ -37,6 +37,7 @@ * ***** END LICENSE BLOCK ***** */ #include +#include "nsXPCOM.h" #include "nsITransactionManager.h" #include "nsIComponentManager.h" @@ -432,21 +433,6 @@ PRInt32 sAggregateBatchTestRedoOrderArr[] = { 295, 296, 297, 298, 299, 300, 301, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458 }; -#ifdef MUST_REGISTER_TXMGR_DLL -#include "nsTransactionManagerCID.h" -static NS_DEFINE_CID(kCTransactionManagerCID, NS_TRANSACTIONMANAGER_CID); - -#ifdef XP_PC -#define TRANSACTION_MANAGER_DLL "txmgr.dll" -#else -#ifdef XP_MAC -#define TRANSACTION_MANAGER_DLL "TRANSACTION_MANAGER_DLL" -#else // XP_UNIX || XP_BEOS -#define TRANSACTION_MANAGER_DLL "libtxmgr"MOZ_DLL_SUFFIX -#endif -#endif -#endif /* MUST_REGISTER_TXMGR_DLL */ - #define TEST_TXMGR_IF_RELEASE(tx) if (tx) tx->Release(); // Release but don't clear pointer! class TestTransaction : public nsITransaction @@ -4704,13 +4690,9 @@ aggregation_batch_stress_test() int main (int argc, char *argv[]) { - nsresult result; - -#ifdef MUST_REGISTER_TXMGR_DLL - nsComponentManager::RegisterComponent(kCTransactionManagerCID, - NULL, NS_TRANSACTIONMANAGER_CONTRACTID, - TRANSACTION_MANAGER_DLL, PR_FALSE, PR_FALSE); -#endif /* MUST_REGISTER_TXMGR_DLL */ + nsresult result = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(result)) + return result; result = simple_test(); diff --git a/mozilla/extensions/pics/src/nsPICS.cpp b/mozilla/extensions/pics/src/nsPICS.cpp index fe1a1772300..f5f23dcd115 100644 --- a/mozilla/extensions/pics/src/nsPICS.cpp +++ b/mozilla/extensions/pics/src/nsPICS.cpp @@ -37,7 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "pratom.h" #include "nsCOMPtr.h" #include "nsIModule.h" diff --git a/mozilla/extensions/pics/src/nsPICSElementObserver.cpp b/mozilla/extensions/pics/src/nsPICSElementObserver.cpp index 946dee07247..086bdb07cc7 100644 --- a/mozilla/extensions/pics/src/nsPICSElementObserver.cpp +++ b/mozilla/extensions/pics/src/nsPICSElementObserver.cpp @@ -37,7 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "pratom.h" #include "nsIFactory.h" #include "nsIServiceManager.h" diff --git a/mozilla/extensions/pics/tests/TestPICS.cpp b/mozilla/extensions/pics/tests/TestPICS.cpp index 53f3fef631b..77261ffca6e 100644 --- a/mozilla/extensions/pics/tests/TestPICS.cpp +++ b/mozilla/extensions/pics/tests/TestPICS.cpp @@ -1,57 +1,17 @@ -#define NS_IMPL_IDS +#include "nsXPCOM.h" #include "nsISupports.h" #include "nsIComponentManager.h" #include "nsIServiceManager.h" #include "nsIPICS.h" -#include "nsIPref.h" -#include "nsIParser.h" -#include "nsParserCIID.h" - -#include "nsIIOService.h" - -#include "nsIObserverService.h" -#include "nsString.h" #include "prmem.h" #include "plstr.h" #include "nspics.h" -#define PICS_DLL "pics.dll" -#define PREF_DLL "xppref32.dll" -#define BASE_DLL "raptorbase.dll" -#define RAPTORHTMLPARS_DLL "gkparser.dll" -#define NETLIB_DLL "netlib.dll" - - - - -static NS_DEFINE_IID(kIPICSIID, NS_IPICS_IID); static NS_DEFINE_IID(kPICSCID, NS_PICS_CID); -static NS_DEFINE_IID(kIPrefIID, NS_IPREF_IID); -static NS_DEFINE_CID(kPrefCID, NS_PREF_CID); - -static NS_DEFINE_IID(kIOServiceCID, NS_IOSERVICE_CID); - -static NS_DEFINE_IID(kCParserIID, NS_IPARSER_IID); -static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); - - PRInt32 main(PRInt32 argc, char *argv[]) { - nsIPICS *pics = NULL; - - nsresult res; - - nsIObserverService* anObserverService; - nsString aTopic("tagobserver"); - - - res = nsRepository::CreateInstance(kPICSCID, - NULL, - kIPICSIID, - (void **) &pics); - char *fileBuf2; char fileBuf[10000] = @@ -81,24 +41,17 @@ PRInt32 main(PRInt32 argc, char *argv[]) char fileBuf10[1000] = "\"(PICS-1.1)"; char fileBuf11[1000] = "(PICS-1.1 \"http://www.rsac.org/ratingsv01.html\" l gen true comment \"RSACi North America Server\" by \"philipd@w3.org\" for \"http://www.w3.org\" on \"1996.04.16T08:15-0500\" r (n 0 s 0 v 0 l 0))"; - if (res == NS_OK) { - // Load preferences - nsComponentManager::RegisterComponent(kPrefCID, NULL, NULL, PREF_DLL, PR_FALSE, PR_FALSE); - - nsComponentManager::RegisterComponent(kIOServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE); - - nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, RAPTORHTMLPARS_DLL, PR_FALSE, PR_FALSE); - - res = nsServiceManager::GetService("@mozilla.org/observer-service;1", - NS_GET_IID(nsIObserverService), - (nsISupports **)&anObserverService); - + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) + return 1; + nsCOMPtr pics = do_CreateInstance(kPICSCID); + + if (pics) pics->ProcessPICSLabel(fileBuf11); - } - + PR_Free(fileBuf2); return 0; } diff --git a/mozilla/extensions/universalchardet/src/nsUniversalCharDetModule.cpp b/mozilla/extensions/universalchardet/src/nsUniversalCharDetModule.cpp index ba624fd7d06..99064a525df 100644 --- a/mozilla/extensions/universalchardet/src/nsUniversalCharDetModule.cpp +++ b/mozilla/extensions/universalchardet/src/nsUniversalCharDetModule.cpp @@ -36,9 +36,7 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsICharsetAlias.h" -#undef NS_IMPL_IDS #include "nsCOMPtr.h" #include "nsIModule.h" diff --git a/mozilla/gfx/tests/coverage/nsCoverage.cpp b/mozilla/gfx/tests/coverage/nsCoverage.cpp index 8bb670ef709..373633fe6e8 100644 --- a/mozilla/gfx/tests/coverage/nsCoverage.cpp +++ b/mozilla/gfx/tests/coverage/nsCoverage.cpp @@ -59,49 +59,24 @@ //------------------------------------------------------------------------------ -nsIEventQueueService *gEventQService = nsnull; - nsIWidget *gWindow = NULL; #ifdef XP_PC -#define XPCOM_DLL "xpcom32.dll" -#define WIDGET_DLL "gkwidget.dll" -#define GFXWIN_DLL "gkgfxwin.dll" #define TEXT_HEIGHT 25 #endif #if defined(XP_UNIX) || defined(XP_BEOS) -#define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX -#ifndef WIDGET_DLL -#define WIDGET_DLL "libwidget_gtk"MOZ_DLL_SUFFIX -#endif -#ifndef GFXWIN_DLL -#define GFXWIN_DLL "libgfx_gtk"MOZ_DLL_SUFFIX -#endif #define TEXT_HEIGHT 30 #endif #ifdef XP_MAC -#define XPCOM_DLL "XPCOM_DLL" -#define WIDGET_DLL "WIDGET_DLL" -#define GFXWIN_DLL "GFXWIN_DLL" #define TEXT_HEIGHT 30 #endif // class ids -static NS_DEFINE_IID(kCWindowCID, NS_WINDOW_CID); -static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID); - -static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -static NS_DEFINE_IID(kEventQueueCID, NS_EVENTQUEUE_CID); -static NS_DEFINE_IID(kCAppShellCID, NS_APPSHELL_CID); -static NS_DEFINE_IID(kCToolkitCID, NS_TOOLKIT_CID); - -// interface ids -static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); -static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); -static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); -static NS_DEFINE_IID(kIAppShellIID, NS_IAPPSHELL_IID); +static NS_DEFINE_CID(kCWindowCID, NS_WINDOW_CID); +static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); +static NS_DEFINE_CID(kCAppShellCID, NS_APPSHELL_CID); // Scroll offsets nscoord gOffsetX = 0; @@ -333,7 +308,7 @@ nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent) break; case NS_DESTROY: - exit(0); // for now + exit(0); // for now break; default: @@ -350,60 +325,28 @@ nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent) */ nsresult CoverageTest(int *argc, char **argv) { - // register xpcom classes - nsComponentManager::RegisterComponentLib(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kEventQueueCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - - // register widget classes - nsComponentManager::RegisterComponentLib(kLookAndFeelCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kCWindowCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); - - nsComponentManager::RegisterComponentLib(kCAppShellCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kCToolkitCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); - static NS_DEFINE_IID(kCRenderingContextIID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kCDeviceContextIID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kCFontMetricsIID, NS_FONT_METRICS_CID); - static NS_DEFINE_IID(kCImageIID, NS_IMAGE_CID); - - - static NS_DEFINE_CID(kScreenManagerCID, NS_SCREENMANAGER_CID); - static NS_DEFINE_IID(kCRenderingContextCID, NS_RENDERING_CONTEXT_CID); - static NS_DEFINE_IID(kCDeviceContextCID, NS_DEVICE_CONTEXT_CID); - static NS_DEFINE_IID(kCFontMetricsCID, NS_FONT_METRICS_CID); - static NS_DEFINE_IID(kCImageCID, NS_IMAGE_CID); - static NS_DEFINE_IID(kCTimerCID, NS_TIMER_CID); - static NS_DEFINE_IID(kCTimerManagerCID, NS_TIMERMANAGER_CID); - nsComponentManager::RegisterComponentLib(kScreenManagerCID, "Screen Manager", "@mozilla.org/gfx/screenmanager;1", GFXWIN_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kCRenderingContextCID, "Rendering Context", "@mozilla.org/gfx/renderingcontext;1", GFXWIN_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kCDeviceContextCID, "Device Context", "@mozilla.org/gfx/devicecontext;1", GFXWIN_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kCFontMetricsCID, "Font Metrics", "@mozilla.org/gfx/fontmetrics;1", GFXWIN_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kCImageCID, "Image", "@mozilla.org/gfx/image;1", GFXWIN_DLL, PR_FALSE, PR_FALSE); -#ifdef XP_PC - nsComponentManager::RegisterComponentLib(kCTimerCID, "Timer", "@mozilla.org/timer;1", WIDGET_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kCTimerManagerCID, NULL, NULL, WIDGET_DLL, PR_FALSE, PR_FALSE); -#endif - - nsresult res; + nsresult res = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(res)) + return res; // Create the Event Queue for the UI thread... - res = nsServiceManager::GetService(kEventQueueServiceCID, - kIEventQueueServiceIID, - (nsISupports **)&gEventQService); + nsCOMPtr eventQService = + do_GetService(kEventQueueServiceCID, &res); if (NS_OK != res) { NS_ASSERTION(PR_FALSE, "Could not obtain the event queue service"); return res; } - res = gEventQService->CreateThreadEventQueue(); + res = eventQService->CreateThreadEventQueue(); if (NS_OK != res) { NS_ASSERTION(PR_FALSE, "Could not create the event queue for the thread"); - return res; + return res; } // Create a application shell nsIAppShell *appShell; - nsComponentManager::CreateInstance(kCAppShellCID, nsnull, kIAppShellIID, (void**)&appShell); + CallCreateInstance(kCAppShellCID, &appShell); if (appShell != nsnull) { fputs("Created AppShell\n", stderr); appShell->Create(argc, argv); @@ -421,7 +364,7 @@ nsresult CoverageTest(int *argc, char **argv) // // create the main window // - nsComponentManager::CreateInstance(kCWindowCID, nsnull, kIWidgetIID, (void**)&gWindow); + CallCreateInstance(kCWindowCID, &gWindow); nsRect rect(100, 100, 600, 700); gWindow->Create((nsIWidget*) nsnull, rect, HandleEvent, (nsIDeviceContext *) nsnull, diff --git a/mozilla/htmlparser/robot/test/RobotMain.cpp b/mozilla/htmlparser/robot/test/RobotMain.cpp index 0fdf54f4301..b3b01bef2bf 100644 --- a/mozilla/htmlparser/robot/test/RobotMain.cpp +++ b/mozilla/htmlparser/robot/test/RobotMain.cpp @@ -1,22 +1,18 @@ -#include +#include "nsXPCOM.h" #include "nsVoidArray.h" -#include "nsIWebShell.h" #include "nsString.h" -#include "nsIComponentManager.h" -#include "nsParserCIID.h" - -#ifdef XP_PC -#define PARSER_DLL "gkparser.dll" -#elif defined(XP_UNIX) || defined(XP_BEOS) -#define PARSER_DLL "libhtmlpars"MOZ_DLL_SUFFIX -#else -#define PARSER_DLL "libraptorhtmlpars"MOZ_DLL_SUFFIX -#endif +class nsIWebShell; extern "C" NS_EXPORT int DebugRobot(nsVoidArray * workList, nsIWebShell * ww); int main(int argc, char **argv) { + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return 1; + } + nsVoidArray * gWorkList = new nsVoidArray(); if(gWorkList) { int i; @@ -27,9 +23,6 @@ int main(int argc, char **argv) } } - static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); - nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - return DebugRobot(gWorkList, nsnull); } diff --git a/mozilla/htmlparser/src/SelfTest.cpp b/mozilla/htmlparser/src/SelfTest.cpp index eaae059fee9..26e5b48897b 100644 --- a/mozilla/htmlparser/src/SelfTest.cpp +++ b/mozilla/htmlparser/src/SelfTest.cpp @@ -42,6 +42,7 @@ #include #include +#include "nsXPCOM.h" #include "nsISupports.h" #include "nsTokenizer.h" #include "nsHTMLDelegate.h" @@ -50,12 +51,6 @@ #include "nsIComponentManager.h" #include "nsParserCIID.h" -#ifdef XP_PC -#define PARSER_DLL "gkparser.dll" -#else -#define PARSER_DLL "libraptorhtmlpars"MOZ_DLL_SUFFIX -#endif - PRBool compareFiles(const char* file1,const char* file2,int& failpos) { PRBool result=PR_TRUE; @@ -221,8 +216,11 @@ int main(int argc, char* argv []) strcpy(buffer,argv[1]); else _getcwd(buffer,_MAX_PATH); - static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); - nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return 1; + } walkDirectoryTree(buffer); return 0; diff --git a/mozilla/htmlparser/src/nsScanner.cpp b/mozilla/htmlparser/src/nsScanner.cpp index e1029ecdbc5..d6b171d7849 100644 --- a/mozilla/htmlparser/src/nsScanner.cpp +++ b/mozilla/htmlparser/src/nsScanner.cpp @@ -38,7 +38,6 @@ //#define __INCREMENTAL 1 -#define NS_IMPL_IDS #include "nsScanner.h" #include "nsDebug.h" #include "nsIServiceManager.h" diff --git a/mozilla/htmlparser/tests/logparse/TestParser.cpp b/mozilla/htmlparser/tests/logparse/TestParser.cpp index 524a25b44fa..e2bad00ba1b 100644 --- a/mozilla/htmlparser/tests/logparse/TestParser.cpp +++ b/mozilla/htmlparser/tests/logparse/TestParser.cpp @@ -35,6 +35,8 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ + +#include "nsXPCOM.h" #include "nsIComponentManager.h" #include "nsParserCIID.h" #include "nsIParser.h" @@ -44,15 +46,6 @@ #include -#ifdef XP_PC -#define PARSER_DLL "gkparser.dll" -#endif -#ifdef XP_MAC -#endif -#if defined(XP_UNIX) || defined(XP_BEOS) -#define PARSER_DLL "libhtmlpars"MOZ_DLL_SUFFIX -#endif - // Class IID's static NS_DEFINE_CID(kParserCID, NS_PARSER_CID); static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_CID); @@ -65,14 +58,6 @@ static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID); //---------------------------------------------------------------------- -static void SetupRegistry() -{ - nsComponentManager::RegisterComponentLib(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kLoggingSinkCID, NULL, NULL, PARSER_DLL,PR_FALSE,PR_FALSE); -} - -//---------------------------------------------------------------------- - nsresult ParseData(char* anInputStream,char* anOutputStream) { nsresult result=NS_OK; @@ -154,11 +139,13 @@ int main(int argc, char** argv) return -1; } - int result=0; - - //SetupRegistry(); + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return -1; + } ParseData(argv[1],argv[2]); - return result; + return 0; } diff --git a/mozilla/htmlparser/tests/logparse/logparse.cpp b/mozilla/htmlparser/tests/logparse/logparse.cpp index b9709b7a260..2a249b6b13b 100644 --- a/mozilla/htmlparser/tests/logparse/logparse.cpp +++ b/mozilla/htmlparser/tests/logparse/logparse.cpp @@ -35,6 +35,8 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ + +#include "nsXPCOM.h" #include "nsIComponentManager.h" #include "nsParserCIID.h" #include "nsIParser.h" @@ -42,15 +44,6 @@ #include "CNavDTD.h" #include -#ifdef XP_PC -#define PARSER_DLL "gkparser.dll" -#endif -#ifdef XP_MAC -#endif -#if defined(XP_UNIX) || defined(XP_BEOS) -#define PARSER_DLL "libhtmlpars"MOZ_DLL_SUFFIX -#endif - // Class IID's static NS_DEFINE_CID(kParserCID, NS_PARSER_CID); static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_IID); @@ -61,14 +54,6 @@ static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID); //---------------------------------------------------------------------- -static void SetupRegistry() -{ - nsComponentManager::RegisterComponent(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kLoggingSinkCID, NULL, NULL, PARSER_DLL,PR_FALSE,PR_FALSE); -} - -//---------------------------------------------------------------------- - static const char* kWorkingDir = "s:/mozilla/htmlparser/tests/logparse"; nsresult GenerateBaselineFile(const char* aSourceFilename,const char* aBaselineFilename) { @@ -206,7 +191,11 @@ int main(int argc, char** argv) int result=0; - SetupRegistry(); + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return 1; + } if(0==strcmp("-c",argv[1])) { diff --git a/mozilla/intl/chardet/src/classic/nsClassicCharDetDll.cpp b/mozilla/intl/chardet/src/classic/nsClassicCharDetDll.cpp index 33511166f9a..7aa24ebc9f4 100644 --- a/mozilla/intl/chardet/src/classic/nsClassicCharDetDll.cpp +++ b/mozilla/intl/chardet/src/classic/nsClassicCharDetDll.cpp @@ -37,9 +37,7 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsICharsetAlias.h" -#undef NS_IMPL_IDS #include "pratom.h" #include "nsClassicCharDetDll.h" diff --git a/mozilla/intl/chardet/src/nsCharDetModule.cpp b/mozilla/intl/chardet/src/nsCharDetModule.cpp index 27cb2e80155..27a92ed367f 100644 --- a/mozilla/intl/chardet/src/nsCharDetModule.cpp +++ b/mozilla/intl/chardet/src/nsCharDetModule.cpp @@ -36,9 +36,7 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsICharsetAlias.h" -#undef NS_IMPL_IDS #include "nsCOMPtr.h" #include "nsIModule.h" diff --git a/mozilla/intl/chardet/src/windows/nsNativeCharDetDll.cpp b/mozilla/intl/chardet/src/windows/nsNativeCharDetDll.cpp index 562b0f93ed3..baa8489914a 100644 --- a/mozilla/intl/chardet/src/windows/nsNativeCharDetDll.cpp +++ b/mozilla/intl/chardet/src/windows/nsNativeCharDetDll.cpp @@ -37,9 +37,7 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsICharsetAlias.h" -#undef NS_IMPL_IDS #include "pratom.h" #include "nsNativeCharDetDll.h" diff --git a/mozilla/intl/chardet/tools/GenCyrillicClass.cpp b/mozilla/intl/chardet/tools/GenCyrillicClass.cpp index d4ad51c87b3..81cf7573b4f 100644 --- a/mozilla/intl/chardet/tools/GenCyrillicClass.cpp +++ b/mozilla/intl/chardet/tools/GenCyrillicClass.cpp @@ -36,9 +36,7 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" -#undef NS_IMPL_IDS #include #include "nsISupports.h" #include "nsIComponentManager.h" diff --git a/mozilla/intl/locale/src/nsCollation.cpp b/mozilla/intl/locale/src/nsCollation.cpp index 453c47b59c5..8f93663e0d7 100644 --- a/mozilla/intl/locale/src/nsCollation.cpp +++ b/mozilla/intl/locale/src/nsCollation.cpp @@ -37,9 +37,7 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #include "nsIServiceManager.h" #include "nsIComponentManager.h" #include "nsCollation.h" diff --git a/mozilla/intl/strres/src/nsAcceptLang.cpp b/mozilla/intl/strres/src/nsAcceptLang.cpp index 2ae65efecab..6f06934faee 100644 --- a/mozilla/intl/strres/src/nsAcceptLang.cpp +++ b/mozilla/intl/strres/src/nsAcceptLang.cpp @@ -37,8 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "prmem.h" #include "nsIMemory.h" #include "nsIServiceManager.h" diff --git a/mozilla/intl/strres/src/nsStringBundle.cpp b/mozilla/intl/strres/src/nsStringBundle.cpp index 816aa7d0dbe..e90e7e80088 100644 --- a/mozilla/intl/strres/src/nsStringBundle.cpp +++ b/mozilla/intl/strres/src/nsStringBundle.cpp @@ -36,7 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsID.h" #include "nsFileSpec.h" #include "nsString.h" diff --git a/mozilla/intl/strres/tests/StringBundleTest.cpp b/mozilla/intl/strres/tests/StringBundleTest.cpp index 22289f1c696..b2c32ed2791 100644 --- a/mozilla/intl/strres/tests/StringBundleTest.cpp +++ b/mozilla/intl/strres/tests/StringBundleTest.cpp @@ -36,8 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "nsCOMPtr.h" #include "nsReadableUtils.h" #include "nsIPersistentProperties2.h" @@ -45,12 +43,12 @@ #include "nsIEventQueueService.h" #include -#include "nsIIOService.h" #include "nsIURL.h" #include "nsIServiceManager.h" #include "nsIComponentRegistrar.h" #include "nsNetCID.h" +#include "nsXPCOM.h" #include "nsIServiceManager.h" #include "nsIComponentManager.h" // @@ -58,30 +56,8 @@ #define TEST_URL "resource:/res/strres.properties" -#ifdef XP_PC -#define NETLIB_DLL "netlib.dll" -#define RAPTORBASE_DLL "raptorbase.dll" -#define XPCOM_DLL "xpcom32.dll" -#else /* else XP_PC */ -#ifdef XP_MAC -#define NETLIB_DLL "NETLIB_DLL" -#define RAPTORBASE_DLL "base.shlb" -#define XPCOM_DLL "XPCOM_DLL" -#else /* else XP_MAC */ -#define NETLIB_DLL "libnecko"MOZ_DLL_SUFFIX -#define RAPTORBASE_DLL "libgklayout"MOZ_DLL_SUFFIX -#define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX -#endif /* XP_MAC */ -#endif /* XP_PC */ - -static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); -static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); - -static NS_DEFINE_IID(kIIOServiceIID, NS_IIOSERVICE_IID); -static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); - -static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); -static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID); +static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); +static NS_DEFINE_CID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID); //////////////////////////////////////////////////////////////////////////////////////////////////// // @@ -148,10 +124,9 @@ main(int argc, char *argv[]) NS_ASSERTION(registrar, "Null nsIComponentRegistrar"); registrar->AutoRegister(nsnull); - nsIStringBundleService* service = nsnull; - ret = nsServiceManager::GetService(kStringBundleServiceCID, - kIStringBundleServiceIID, (nsISupports**) &service); - if (NS_FAILED(ret)) { + nsCOMPtr service = + do_GetService(kStringBundleServiceCID); + if (!service) { printf("cannot create service\n"); return 1; } diff --git a/mozilla/intl/uconv/src/nsCharsetAliasImp.cpp b/mozilla/intl/uconv/src/nsCharsetAliasImp.cpp index 813c572f8ab..4b5cc3c0dcd 100644 --- a/mozilla/intl/uconv/src/nsCharsetAliasImp.cpp +++ b/mozilla/intl/uconv/src/nsCharsetAliasImp.cpp @@ -37,9 +37,6 @@ * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - - #include "nsICharsetAlias.h" #include "pratom.h" diff --git a/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp b/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp index e9b08a31d69..434fb08c061 100644 --- a/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp @@ -37,8 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "nsCOMPtr.h" #include "nsString.h" #include "nsReadableUtils.h" diff --git a/mozilla/intl/uconv/src/nsScriptableUConv.cpp b/mozilla/intl/uconv/src/nsScriptableUConv.cpp index b3387b2ff8a..9f9d8f7f677 100644 --- a/mozilla/intl/uconv/src/nsScriptableUConv.cpp +++ b/mozilla/intl/uconv/src/nsScriptableUConv.cpp @@ -47,9 +47,7 @@ #include "nsIScriptableUConv.h" #include "nsScriptableUConv.h" -#define NS_IMPL_IDS #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS static NS_DEFINE_CID(kIScriptableUnicodeConverterCID, NS_ISCRIPTABLEUNICODECONVERTER_CID); static NS_DEFINE_CID(kCharsetConverterManagerCID, NS_ICHARSETCONVERTERMANAGER_CID); diff --git a/mozilla/intl/uconv/tests/nsTestUConv.cpp b/mozilla/intl/uconv/tests/nsTestUConv.cpp index a3cb285617c..4c4eaa291d3 100644 --- a/mozilla/intl/uconv/tests/nsTestUConv.cpp +++ b/mozilla/intl/uconv/tests/nsTestUConv.cpp @@ -37,10 +37,9 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include #include +#include "nsXPCOM.h" #include "nsIComponentManager.h" #include "nsIServiceManager.h" #include "nsISupports.h" @@ -98,27 +97,6 @@ PRUnichar cLatin1_d0[] = { PRInt32 bLatin1_s0 = ARRAY_SIZE(bLatin1_d0)-1; PRInt32 cLatin1_s0 = ARRAY_SIZE(cLatin1_d0); - -//---------------------------------------------------------------------- -// Registry setup function(s) - -nsresult setupRegistry() -{ - /** - * Ok, here's where we used to register the components needed to run the - * tests. This is not necessary anymore, as the auto-registration stuff - * is in place now. But, as we don't trigger the autoregistration in - * this test program, you make sure you first run an autoreg app (like - * viewer). Included is an example of the old code, in case we'll need it. - * - * nsresult res = nsComponentManager::RegisterComponent( - * kCharsetConverterManagerCID, NULL, NULL, UCONV_DLL, PR_FALSE, PR_FALSE); - * if (NS_FAILED(res) && (NS_ERROR_FACTORY_EXISTS != res)) return res; - */ - - return NS_OK; -} - //---------------------------------------------------------------------- // Converter Manager test code @@ -1153,8 +1131,6 @@ nsresult testAll() nsresult testFromArgs(int argc, char **argv) { - nsresult res = nsServiceManager::GetService(kCharsetConverterManagerCID, - kICharsetConverterManagerIID, (nsISupports **)&ccMan); if (NS_FAILED(res)) { printf("ERROR at GetService() code=0x%x.\n",res); return res; @@ -1179,22 +1155,15 @@ nsresult testFromArgs(int argc, char **argv) nsresult init() { - nsresult res; - - res = setupRegistry(); - if (NS_FAILED(res)) { - printf("ERROR at setupRegistry() code=0x%x.\n", res); - return res; - } - - return NS_OK; + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) + return rv; + return CallGetService(kCharsetConverterManagerCID, &ccMan); } nsresult done() { - if (ccMan != NULL) nsServiceManager:: - ReleaseService(kCharsetConverterManagerCID, ccMan); - + NS_RELEASE(ccMan); return NS_OK; } diff --git a/mozilla/intl/uconv/ucvcn/nsUCvCnModule.cpp b/mozilla/intl/uconv/ucvcn/nsUCvCnModule.cpp index 76ffde1c2a6..970a501407d 100644 --- a/mozilla/intl/uconv/ucvcn/nsUCvCnModule.cpp +++ b/mozilla/intl/uconv/ucvcn/nsUCvCnModule.cpp @@ -37,8 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "nspr.h" #include "nsString.h" #include "pratom.h" diff --git a/mozilla/intl/uconv/ucvibm/nsUCvIBMModule.cpp b/mozilla/intl/uconv/ucvibm/nsUCvIBMModule.cpp index 411933e8cc3..9839eb994d0 100644 --- a/mozilla/intl/uconv/ucvibm/nsUCvIBMModule.cpp +++ b/mozilla/intl/uconv/ucvibm/nsUCvIBMModule.cpp @@ -34,8 +34,6 @@ * */ -#define NS_IMPL_IDS - #include "pratom.h" #include "nspr.h" #include "nsString.h" diff --git a/mozilla/intl/uconv/ucvja/nsUCvJaModule.cpp b/mozilla/intl/uconv/ucvja/nsUCvJaModule.cpp index f5297d5005e..df0780afba1 100644 --- a/mozilla/intl/uconv/ucvja/nsUCvJaModule.cpp +++ b/mozilla/intl/uconv/ucvja/nsUCvJaModule.cpp @@ -35,7 +35,6 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nspr.h" #include "nsString.h" diff --git a/mozilla/intl/uconv/ucvko/nsUCvKoModule.cpp b/mozilla/intl/uconv/ucvko/nsUCvKoModule.cpp index 85eb24977dc..8888ed0b29f 100644 --- a/mozilla/intl/uconv/ucvko/nsUCvKoModule.cpp +++ b/mozilla/intl/uconv/ucvko/nsUCvKoModule.cpp @@ -38,8 +38,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "nspr.h" #include "nsString.h" #include "pratom.h" diff --git a/mozilla/intl/uconv/ucvlatin/nsUCvLatinModule.cpp b/mozilla/intl/uconv/ucvlatin/nsUCvLatinModule.cpp index ebfdb9eec3b..fb5a4b0017b 100644 --- a/mozilla/intl/uconv/ucvlatin/nsUCvLatinModule.cpp +++ b/mozilla/intl/uconv/ucvlatin/nsUCvLatinModule.cpp @@ -37,8 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "pratom.h" #include "nspr.h" #include "nsString.h" diff --git a/mozilla/intl/uconv/ucvmath/nsUCvMathModule.cpp b/mozilla/intl/uconv/ucvmath/nsUCvMathModule.cpp index ebc2a1ed81c..8a4a4bf5fbb 100644 --- a/mozilla/intl/uconv/ucvmath/nsUCvMathModule.cpp +++ b/mozilla/intl/uconv/ucvmath/nsUCvMathModule.cpp @@ -37,8 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "pratom.h" #include "nspr.h" #include "nsString.h" diff --git a/mozilla/intl/uconv/ucvtw/nsUCvTwModule.cpp b/mozilla/intl/uconv/ucvtw/nsUCvTwModule.cpp index 3931fd9d87c..8b59e697288 100644 --- a/mozilla/intl/uconv/ucvtw/nsUCvTwModule.cpp +++ b/mozilla/intl/uconv/ucvtw/nsUCvTwModule.cpp @@ -35,7 +35,6 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nspr.h" #include "nsString.h" diff --git a/mozilla/intl/uconv/ucvtw2/nsUCvTw2Module.cpp b/mozilla/intl/uconv/ucvtw2/nsUCvTw2Module.cpp index d8942c158b6..b6664bd76fc 100644 --- a/mozilla/intl/uconv/ucvtw2/nsUCvTw2Module.cpp +++ b/mozilla/intl/uconv/ucvtw2/nsUCvTw2Module.cpp @@ -38,8 +38,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "nspr.h" #include "nsString.h" #include "pratom.h" diff --git a/mozilla/intl/unicharutil/src/nsSaveAsCharset.cpp b/mozilla/intl/unicharutil/src/nsSaveAsCharset.cpp index 860a47d7fbe..f166478a40a 100644 --- a/mozilla/intl/unicharutil/src/nsSaveAsCharset.cpp +++ b/mozilla/intl/unicharutil/src/nsSaveAsCharset.cpp @@ -37,10 +37,8 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" #include "nsICharsetAlias.h" -#undef NS_IMPL_IDS #include "prmem.h" #include "prprf.h" diff --git a/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp b/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp index 1e66ff4fd8f..60721103e1e 100644 --- a/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp +++ b/mozilla/intl/unicharutil/tests/UnicharSelfTest.cpp @@ -38,6 +38,7 @@ * ***** END LICENSE BLOCK ***** */ #include #include "nsISupports.h" +#include "nsXPCOM.h" #include "nsIServiceManager.h" #include "nsIComponentManager.h" #include "nsICaseConversion.h" @@ -57,12 +58,6 @@ NS_DEFINE_CID(kEntityConverterCID, NS_ENTITYCONVERTER_CID); NS_DEFINE_CID(kSaveAsCharsetCID, NS_SAVEASCHARSET_CID); NS_DEFINE_IID(kIPersistentPropertiesIID,NS_IPERSISTENTPROPERTIES_IID); -#if defined(XP_UNIX) || defined(XP_BEOS) -#define UNICHARUTIL_DLL_NAME "libunicharutil"MOZ_DLL_SUFFIX -#else -#define UNICHARUTIL_DLL_NAME "UNICHARUTIL_DLL" -#endif - #define TESTLEN 29 #define T2LEN TESTLEN #define T3LEN TESTLEN @@ -520,24 +515,13 @@ static void TestSaveAsCharset() cout << "==============================\n\n"; } -void RegisterFactories() -{ - nsresult res; - res = nsComponentManager::RegisterComponent(kUnicharUtilCID, - NULL, - NULL, - UNICHARUTIL_DLL_NAME, - PR_FALSE, - PR_TRUE); - if(NS_FAILED(res)) - cout << "RegisterComponent failed\n"; -} - int main(int argc, char** argv) { -#ifndef USE_NSREG - RegisterFactories(); -#endif + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return 1; + } // -------------------------------------------- diff --git a/mozilla/layout/html/forms/src/nsFormFrame.cpp b/mozilla/layout/html/forms/src/nsFormFrame.cpp index ab8675e4cb0..c4b1b10c851 100644 --- a/mozilla/layout/html/forms/src/nsFormFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFormFrame.cpp @@ -39,11 +39,9 @@ -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" #include "nsICharsetAlias.h" #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #include "nsCOMPtr.h" #include "nsXPIDLString.h" diff --git a/mozilla/mailnews/base/util/nsMsgI18N.cpp b/mozilla/mailnews/base/util/nsMsgI18N.cpp index a7ebcc3d617..4256ab75d59 100644 --- a/mozilla/mailnews/base/util/nsMsgI18N.cpp +++ b/mozilla/mailnews/base/util/nsMsgI18N.cpp @@ -37,11 +37,9 @@ * ***** END LICENSE BLOCK ***** */ // as does this -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" #include "nsICharsetAlias.h" #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #include "nsIServiceManager.h" #include "nsICharsetConverterManager2.h" diff --git a/mozilla/mailnews/imap/src/nsImapProtocol.cpp b/mozilla/mailnews/imap/src/nsImapProtocol.cpp index 3a171bc19ff..a826c9b6a3a 100644 --- a/mozilla/mailnews/imap/src/nsImapProtocol.cpp +++ b/mozilla/mailnews/imap/src/nsImapProtocol.cpp @@ -43,7 +43,6 @@ #endif // as does this -#define NS_IMPL_IDS #include "msgCore.h" // for pre-compiled headers #include "nsIServiceManager.h" diff --git a/mozilla/mailnews/import/src/nsImportService.cpp b/mozilla/mailnews/import/src/nsImportService.cpp index 36c1e1ef7e3..2e0b0b9567b 100644 --- a/mozilla/mailnews/import/src/nsImportService.cpp +++ b/mozilla/mailnews/import/src/nsImportService.cpp @@ -37,11 +37,9 @@ * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" #include "nsICharsetAlias.h" #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #include "nsICharsetConverterManager2.h" #include "nsCRT.h" diff --git a/mozilla/mailnews/local/src/nsLocalMailFolder.cpp b/mozilla/mailnews/local/src/nsLocalMailFolder.cpp index c1517aa8caf..c83532a5850 100644 --- a/mozilla/mailnews/local/src/nsLocalMailFolder.cpp +++ b/mozilla/mailnews/local/src/nsLocalMailFolder.cpp @@ -42,7 +42,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsIPref.h" #include "prlog.h" diff --git a/mozilla/mailnews/mime/cthandlers/vcard/mimevcrd.cpp b/mozilla/mailnews/mime/cthandlers/vcard/mimevcrd.cpp index ec751247ac4..8caf0639704 100644 --- a/mozilla/mailnews/mime/cthandlers/vcard/mimevcrd.cpp +++ b/mozilla/mailnews/mime/cthandlers/vcard/mimevcrd.cpp @@ -34,7 +34,6 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsCOMPtr.h" #include "nsIIOService.h" #include "nsNetCID.h" diff --git a/mozilla/mailnews/mime/src/comi18n.cpp b/mozilla/mailnews/mime/src/comi18n.cpp index d946bb50e7d..3b4f4d34859 100644 --- a/mozilla/mailnews/mime/src/comi18n.cpp +++ b/mozilla/mailnews/mime/src/comi18n.cpp @@ -35,10 +35,9 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS + #include "nsICharsetConverterManager.h" #include "nsICharsetAlias.h" -#undef NS_IMPL_IDS #include #include diff --git a/mozilla/mailnews/news/src/nsNewsFolder.cpp b/mozilla/mailnews/news/src/nsNewsFolder.cpp index f691687fd3d..bfd66f268e4 100644 --- a/mozilla/mailnews/news/src/nsNewsFolder.cpp +++ b/mozilla/mailnews/news/src/nsNewsFolder.cpp @@ -38,7 +38,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsIPref.h" #include "prlog.h" diff --git a/mozilla/parser/htmlparser/robot/test/RobotMain.cpp b/mozilla/parser/htmlparser/robot/test/RobotMain.cpp index 0fdf54f4301..b3b01bef2bf 100644 --- a/mozilla/parser/htmlparser/robot/test/RobotMain.cpp +++ b/mozilla/parser/htmlparser/robot/test/RobotMain.cpp @@ -1,22 +1,18 @@ -#include +#include "nsXPCOM.h" #include "nsVoidArray.h" -#include "nsIWebShell.h" #include "nsString.h" -#include "nsIComponentManager.h" -#include "nsParserCIID.h" - -#ifdef XP_PC -#define PARSER_DLL "gkparser.dll" -#elif defined(XP_UNIX) || defined(XP_BEOS) -#define PARSER_DLL "libhtmlpars"MOZ_DLL_SUFFIX -#else -#define PARSER_DLL "libraptorhtmlpars"MOZ_DLL_SUFFIX -#endif +class nsIWebShell; extern "C" NS_EXPORT int DebugRobot(nsVoidArray * workList, nsIWebShell * ww); int main(int argc, char **argv) { + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return 1; + } + nsVoidArray * gWorkList = new nsVoidArray(); if(gWorkList) { int i; @@ -27,9 +23,6 @@ int main(int argc, char **argv) } } - static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); - nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - return DebugRobot(gWorkList, nsnull); } diff --git a/mozilla/parser/htmlparser/src/SelfTest.cpp b/mozilla/parser/htmlparser/src/SelfTest.cpp index eaae059fee9..26e5b48897b 100644 --- a/mozilla/parser/htmlparser/src/SelfTest.cpp +++ b/mozilla/parser/htmlparser/src/SelfTest.cpp @@ -42,6 +42,7 @@ #include #include +#include "nsXPCOM.h" #include "nsISupports.h" #include "nsTokenizer.h" #include "nsHTMLDelegate.h" @@ -50,12 +51,6 @@ #include "nsIComponentManager.h" #include "nsParserCIID.h" -#ifdef XP_PC -#define PARSER_DLL "gkparser.dll" -#else -#define PARSER_DLL "libraptorhtmlpars"MOZ_DLL_SUFFIX -#endif - PRBool compareFiles(const char* file1,const char* file2,int& failpos) { PRBool result=PR_TRUE; @@ -221,8 +216,11 @@ int main(int argc, char* argv []) strcpy(buffer,argv[1]); else _getcwd(buffer,_MAX_PATH); - static NS_DEFINE_CID(kCParserCID, NS_PARSER_CID); - nsComponentManager::RegisterComponent(kCParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return 1; + } walkDirectoryTree(buffer); return 0; diff --git a/mozilla/parser/htmlparser/src/nsScanner.cpp b/mozilla/parser/htmlparser/src/nsScanner.cpp index e1029ecdbc5..d6b171d7849 100644 --- a/mozilla/parser/htmlparser/src/nsScanner.cpp +++ b/mozilla/parser/htmlparser/src/nsScanner.cpp @@ -38,7 +38,6 @@ //#define __INCREMENTAL 1 -#define NS_IMPL_IDS #include "nsScanner.h" #include "nsDebug.h" #include "nsIServiceManager.h" diff --git a/mozilla/parser/htmlparser/tests/logparse/TestParser.cpp b/mozilla/parser/htmlparser/tests/logparse/TestParser.cpp index 524a25b44fa..e2bad00ba1b 100644 --- a/mozilla/parser/htmlparser/tests/logparse/TestParser.cpp +++ b/mozilla/parser/htmlparser/tests/logparse/TestParser.cpp @@ -35,6 +35,8 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ + +#include "nsXPCOM.h" #include "nsIComponentManager.h" #include "nsParserCIID.h" #include "nsIParser.h" @@ -44,15 +46,6 @@ #include -#ifdef XP_PC -#define PARSER_DLL "gkparser.dll" -#endif -#ifdef XP_MAC -#endif -#if defined(XP_UNIX) || defined(XP_BEOS) -#define PARSER_DLL "libhtmlpars"MOZ_DLL_SUFFIX -#endif - // Class IID's static NS_DEFINE_CID(kParserCID, NS_PARSER_CID); static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_CID); @@ -65,14 +58,6 @@ static NS_DEFINE_CID(kNavDTDCID, NS_CNAVDTD_CID); //---------------------------------------------------------------------- -static void SetupRegistry() -{ - nsComponentManager::RegisterComponentLib(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponentLib(kLoggingSinkCID, NULL, NULL, PARSER_DLL,PR_FALSE,PR_FALSE); -} - -//---------------------------------------------------------------------- - nsresult ParseData(char* anInputStream,char* anOutputStream) { nsresult result=NS_OK; @@ -154,11 +139,13 @@ int main(int argc, char** argv) return -1; } - int result=0; - - //SetupRegistry(); + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return -1; + } ParseData(argv[1],argv[2]); - return result; + return 0; } diff --git a/mozilla/parser/htmlparser/tests/logparse/logparse.cpp b/mozilla/parser/htmlparser/tests/logparse/logparse.cpp index b9709b7a260..2a249b6b13b 100644 --- a/mozilla/parser/htmlparser/tests/logparse/logparse.cpp +++ b/mozilla/parser/htmlparser/tests/logparse/logparse.cpp @@ -35,6 +35,8 @@ * the terms of any one of the NPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ + +#include "nsXPCOM.h" #include "nsIComponentManager.h" #include "nsParserCIID.h" #include "nsIParser.h" @@ -42,15 +44,6 @@ #include "CNavDTD.h" #include -#ifdef XP_PC -#define PARSER_DLL "gkparser.dll" -#endif -#ifdef XP_MAC -#endif -#if defined(XP_UNIX) || defined(XP_BEOS) -#define PARSER_DLL "libhtmlpars"MOZ_DLL_SUFFIX -#endif - // Class IID's static NS_DEFINE_CID(kParserCID, NS_PARSER_CID); static NS_DEFINE_IID(kLoggingSinkCID, NS_LOGGING_SINK_IID); @@ -61,14 +54,6 @@ static NS_DEFINE_IID(kILoggingSinkIID, NS_ILOGGING_SINK_IID); //---------------------------------------------------------------------- -static void SetupRegistry() -{ - nsComponentManager::RegisterComponent(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kLoggingSinkCID, NULL, NULL, PARSER_DLL,PR_FALSE,PR_FALSE); -} - -//---------------------------------------------------------------------- - static const char* kWorkingDir = "s:/mozilla/htmlparser/tests/logparse"; nsresult GenerateBaselineFile(const char* aSourceFilename,const char* aBaselineFilename) { @@ -206,7 +191,11 @@ int main(int argc, char** argv) int result=0; - SetupRegistry(); + nsresult rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + printf("NS_InitXPCOM2 failed\n"); + return 1; + } if(0==strcmp("-c",argv[1])) { diff --git a/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp b/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp index 8826c183ee7..28c4003ca56 100644 --- a/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp +++ b/mozilla/profile/pref-migrator/src/nsPrefMigration.cpp @@ -85,10 +85,8 @@ #define DEBUG_UTF8_CONVERSION 1 #endif -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #define CHROME_STYLE nsIWebBrowserChrome::CHROME_ALL | nsIWebBrowserChrome::CHROME_CENTER_SCREEN #define MIGRATION_PROPERTIES_URL "chrome://communicator/locale/profile/migration.properties" diff --git a/mozilla/profile/src/nsProfileAccess.cpp b/mozilla/profile/src/nsProfileAccess.cpp index 577afa1c27d..0f285415753 100644 --- a/mozilla/profile/src/nsProfileAccess.cpp +++ b/mozilla/profile/src/nsProfileAccess.cpp @@ -39,10 +39,8 @@ #include "nsILocalFile.h" #include "nsReadableUtils.h" -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #define MAX_PERSISTENT_DATA_SIZE 1000 #define NUM_HEX_BYTES 8 diff --git a/mozilla/rdf/tests/localfile/localfile.cpp b/mozilla/rdf/tests/localfile/localfile.cpp index f2bbc281e6b..189f2094415 100644 --- a/mozilla/rdf/tests/localfile/localfile.cpp +++ b/mozilla/rdf/tests/localfile/localfile.cpp @@ -55,6 +55,7 @@ #include #endif +#include "nsXPCOM.h" #include "nsIContent.h" #include "nsIEventQueueService.h" #include "nsIInputStream.h" @@ -78,29 +79,6 @@ #include "plstr.h" #include "rdf.h" -#if defined(XP_PC) -#define DOM_DLL "jsdom.dll" -#define LAYOUT_DLL "gkhtml.dll" -#define NETLIB_DLL "netlib.dll" -#define PARSER_DLL "gkparser.dll" -#define RDF_DLL "rdf.dll" -#define XPCOM_DLL "xpcom32.dll" -#elif defined(XP_UNIX) || defined(XP_BEOS) -#define DOM_DLL "libjsdom"MOZ_DLL_SUFFIX -#define LAYOUT_DLL "libgklayout"MOZ_DLL_SUFFIX -#define NETLIB_DLL "libnecko"MOZ_DLL_SUFFIX -#define PARSER_DLL "libtmlpars"MOZ_DLL_SUFFIX -#define RDF_DLL "librdf"MOZ_DLL_SUFFIX -#define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX -#elif defined(XP_MAC) -#define DOM_DLL "DOM_DLL" -#define LAYOUT_DLL "LAYOUT_DLL" -#define NETLIB_DLL "NETLIB_DLL" -#define PARSER_DLL "PARSER_DLL" -#define RDF_DLL "RDF_DLL" -#define XPCOM_DLL "XPCOM_DLL" -#endif - //////////////////////////////////////////////////////////////////////// // CIDs @@ -115,16 +93,6 @@ static NS_DEFINE_CID(kRDFCompositeDataSourceCID, NS_RDFCOMPOSITEDATASOURCE_CID); static NS_DEFINE_CID(kRDFContentSinkCID, NS_RDFCONTENTSINK_CID); static NS_DEFINE_CID(kRDFXMLDataSourceCID, NS_RDFXMLDATASOURCE_CID); -// parser -static NS_DEFINE_CID(kParserCID, NS_PARSER_CID); -static NS_DEFINE_CID(kWellFormedDTDCID, NS_WELLFORMEDDTD_CID); - -// layout -static NS_DEFINE_CID(kNameSpaceManagerCID, NS_NAMESPACEMANAGER_CID); - -// dom -static NS_DEFINE_IID(kScriptNameSetRegistryCID, NS_SCRIPT_NAMESET_REGISTRY_CID); - // xpcom static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); @@ -138,29 +106,6 @@ NS_DEFINE_IID(kIRDFDataSourceIID, NS_IRDFDATASOURCE_IID); NS_DEFINE_IID(kIRDFServiceIID, NS_IRDFSERVICE_IID); NS_DEFINE_IID(kIRDFXMLDataSourceIID, NS_IRDFXMLDATASOURCE_IID); -static nsresult -SetupRegistry(void) -{ - // netlib - nsComponentManager::RegisterComponent(kIOServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE); - - // parser - nsComponentManager::RegisterComponent(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kWellFormedDTDCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - - // layout - nsComponentManager::RegisterComponent(kNameSpaceManagerCID, NULL, NULL, LAYOUT_DLL, PR_FALSE, PR_FALSE); - - // dom - nsComponentManager::RegisterComponent(kScriptNameSetRegistryCID, NULL, NULL, DOM_DLL, PR_FALSE, PR_FALSE); - - // xpcom - nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - - return NS_OK; -} - - //////////////////////////////////////////////////////////////////////// int @@ -173,7 +118,11 @@ main(int argc, char** argv) return 1; } - SetupRegistry(); + rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + fprintf(stderr, "NS_InitXPCOM2 failed\n"); + return 1; + } nsIEventQueueService* theEventQueueService = nsnull; nsIEventQueue* mainQueue = nsnull; diff --git a/mozilla/rdf/tests/rdfpoll/rdfpoll.cpp b/mozilla/rdf/tests/rdfpoll/rdfpoll.cpp index bd89212cb61..1d8ae7b61ca 100644 --- a/mozilla/rdf/tests/rdfpoll/rdfpoll.cpp +++ b/mozilla/rdf/tests/rdfpoll/rdfpoll.cpp @@ -48,6 +48,7 @@ */ #include +#include "nsXPCOM.h" #include "nsCOMPtr.h" #include "nsIEventQueueService.h" #include "nsIInputStream.h" @@ -61,44 +62,16 @@ #include "nsIServiceManager.h" #include "nsIStreamListener.h" #include "nsIURL.h" -#include "nsDOMCID.h" // for NS_SCRIPT_NAMESET_REGISTRY_CID -#include "nsLayoutCID.h" // for NS_NAMESPACEMANAGER_CID -#include "nsRDFCID.h" #include "nsRDFCID.h" #include "nsIComponentManager.h" #include "nsXPIDLString.h" #include "prthread.h" #include "plevent.h" #include "plstr.h" -#include "nsParserCIID.h" #include "nsString.h" #include "nsReadableUtils.h" #include "nsNetCID.h" -#if defined(XP_PC) -#define DOM_DLL "jsdom.dll" -#define LAYOUT_DLL "gkhtml.dll" -#define NETLIB_DLL "netlib.dll" -#define PARSER_DLL "gkparser.dll" -#define RDF_DLL "rdf.dll" -#define XPCOM_DLL "xpcom32.dll" -#elif defined(XP_UNIX) || defined(XP_BEOS) -#define DOM_DLL "libjsdom"MOZ_DLL_SUFFIX -#define LAYOUT_DLL "libgklayout"MOZ_DLL_SUFFIX -#define NETLIB_DLL "libnecko"MOZ_DLL_SUFFIX -#define PARSER_DLL "libhtmlpars"MOZ_DLL_SUFFIX -#define RDF_DLL "librdf"MOZ_DLL_SUFFIX -#define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX -#elif defined(XP_MAC) -#define DOM_DLL "DOM_DLL" -#define LAYOUT_DLL "LAYOUT_DLL" -#define NETLIB_DLL "NETLIB_DLL" -#define PARSER_DLL "PARSER_DLL" -#define RDF_DLL "RDF_DLL" -#define XPCOM_DLL "XPCOM_DLL" -#endif - - //////////////////////////////////////////////////////////////////////// // CIDs @@ -117,36 +90,6 @@ NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID); #include "nsIMemory.h" // for the CID -static nsresult -SetupRegistry(void) -{ - // netlib - static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); - nsComponentManager::RegisterComponent(kIOServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE); - - // parser - static NS_DEFINE_CID(kParserCID, NS_PARSER_CID); - static NS_DEFINE_IID(kExpatDriverCID, NS_EXPAT_DRIVER_CID); - - nsComponentManager::RegisterComponent(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kExpatDriverCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - - // layout - static NS_DEFINE_CID(kNameSpaceManagerCID, NS_NAMESPACEMANAGER_CID); - - nsComponentManager::RegisterComponent(kNameSpaceManagerCID, NULL, NULL, LAYOUT_DLL, PR_FALSE, PR_FALSE); - - // xpcom - static NS_DEFINE_CID(kMemoryCID, NS_MEMORY_CID); - static NS_DEFINE_CID(kEventQueueCID, NS_EVENTQUEUE_CID); - nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kEventQueueCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kGenericFactoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kMemoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - - return NS_OK; -} - //////////////////////////////////////////////////////////////////////// class Observer : public nsIRDFObserver @@ -321,7 +264,11 @@ main(int argc, char** argv) return 1; } - SetupRegistry(); + rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + fprintf(stderr, "NS_InitXPCOM2 failed\n"); + return 1; + } // Get netlib off the floor... nsCOMPtr theEventQueueService = diff --git a/mozilla/rdf/tests/rdfsink/rdfsink.cpp b/mozilla/rdf/tests/rdfsink/rdfsink.cpp index 90a46f3e6f7..3221de99a63 100644 --- a/mozilla/rdf/tests/rdfsink/rdfsink.cpp +++ b/mozilla/rdf/tests/rdfsink/rdfsink.cpp @@ -35,6 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ +#include "nsXPCOM.h" #include "nsIEventQueueService.h" #include "nsIInputStream.h" #include "nsIIOService.h" @@ -50,38 +51,11 @@ #include "nsIServiceManager.h" #include "nsIStreamListener.h" #include "nsIURL.h" -#include "nsDOMCID.h" // for NS_SCRIPT_NAMESET_REGISTRY_CID -#include "nsLayoutCID.h" // for NS_NAMESPACEMANAGER_CID -#include "nsRDFCID.h" #include "nsRDFCID.h" #include "nsIComponentManager.h" #include "plevent.h" #include "plstr.h" -#if defined(XP_PC) -#define DOM_DLL "jsdom.dll" -#define LAYOUT_DLL "gkhtml.dll" -#define NETLIB_DLL "netlib.dll" -#define PARSER_DLL "gkparser.dll" -#define RDF_DLL "rdf.dll" -#define XPCOM_DLL "xpcom32.dll" -#elif defined(XP_UNIX) || defined(XP_BEOS) -#define DOM_DLL "libjsdom"MOZ_DLL_SUFFIX -#define LAYOUT_DLL "libgklayout"MOZ_DLL_SUFFIX -#define NETLIB_DLL "libnecko"MOZ_DLL_SUFFIX -#define PARSER_DLL "libhtmlpars"MOZ_DLL_SUFFIX -#define RDF_DLL "librdf"MOZ_DLL_SUFFIX -#define XPCOM_DLL "libxpcom"MOZ_DLL_SUFFIX -#elif defined(XP_MAC) -#define DOM_DLL "DOM_DLL" -#define LAYOUT_DLL "LAYOUT_DLL" -#define NETLIB_DLL "NETLIB_DLL" -#define PARSER_DLL "PARSER_DLL" -#define RDF_DLL "RDF_DLL" -#define XPCOM_DLL "XPCOM_DLL" -#endif - - //////////////////////////////////////////////////////////////////////// // CIDs @@ -101,33 +75,6 @@ NS_DEFINE_IID(kIRDFXMLDataSourceIID, NS_IRDFXMLDATASOURCE_IID); NS_DEFINE_IID(kIRDFServiceIID, NS_IRDFSERVICE_IID); NS_DEFINE_IID(kIRDFXMLSourceIID, NS_IRDFXMLSOURCE_IID); -static nsresult -SetupRegistry(void) -{ - // netlib - static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); - nsComponentManager::RegisterComponent(kIOServiceCID, NULL, NULL, NETLIB_DLL, PR_FALSE, PR_FALSE); - - // parser - static NS_DEFINE_CID(kParserCID, NS_PARSER_CID); - static NS_DEFINE_CID(kWellFormedDTDCID, NS_WELLFORMEDDTD_CID); - - nsComponentManager::RegisterComponent(kParserCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kWellFormedDTDCID, NULL, NULL, PARSER_DLL, PR_FALSE, PR_FALSE); - - // layout - static NS_DEFINE_CID(kNameSpaceManagerCID, NS_NAMESPACEMANAGER_CID); - - nsComponentManager::RegisterComponent(kNameSpaceManagerCID, NULL, NULL, LAYOUT_DLL, PR_FALSE, PR_FALSE); - - // xpcom - nsComponentManager::RegisterComponent(kEventQueueServiceCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - nsComponentManager::RegisterComponent(kGenericFactoryCID, NULL, NULL, XPCOM_DLL, PR_FALSE, PR_FALSE); - - return NS_OK; -} - - //////////////////////////////////////////////////////////////////////// class ConsoleOutputStreamImpl : public nsIOutputStream @@ -173,7 +120,11 @@ main(int argc, char** argv) return 1; } - SetupRegistry(); + rv = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(rv)) { + fprintf(stderr, "NS_InitXPCOM2 failed\n"); + return 1; + } nsIEventQueueService* theEventQueueService = nsnull; nsIEventQueue* mainQueue = nsnull; diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 42bc794db2f..1115c56f5a2 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -31,13 +31,7 @@ #include "nsIPref.h" #include "prmem.h" -#if defined(XP_MAC) || defined(XP_MACOSX) #include "nsBrowserWindow.h" -#define NS_IMPL_IDS -#else -#define NS_IMPL_IDS -#include "nsBrowserWindow.h" -#endif #include "nsIAppShell.h" #include "nsIWidget.h" #include "nsITextWidget.h" diff --git a/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp b/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp index 212e200874d..0e8c26cba9c 100644 --- a/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsXPBaseWindow.cpp @@ -38,13 +38,7 @@ #include "nsIPref.h" #include "prmem.h" -#ifdef XP_MAC #include "nsXPBaseWindow.h" -#define NS_IMPL_IDS -#else -#define NS_IMPL_IDS -#include "nsXPBaseWindow.h" -#endif #include "nsCOMPtr.h" #include "nsIPrompt.h" diff --git a/mozilla/widget/src/beos/nsFilePicker.cpp b/mozilla/widget/src/beos/nsFilePicker.cpp index e854888a79b..ba7441e94c3 100644 --- a/mozilla/widget/src/beos/nsFilePicker.cpp +++ b/mozilla/widget/src/beos/nsFilePicker.cpp @@ -24,9 +24,7 @@ #include "nsCOMPtr.h" #include "nsNetUtil.h" #include "nsIServiceManager.h" -#define NS_IMPL_IDS #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #include "nsFilePicker.h" #include "nsILocalFile.h" #include "nsIURL.h" diff --git a/mozilla/widget/src/beos/nsFilePicker.h b/mozilla/widget/src/beos/nsFilePicker.h index b65b461ea2c..3c210c8100d 100644 --- a/mozilla/widget/src/beos/nsFilePicker.h +++ b/mozilla/widget/src/beos/nsFilePicker.h @@ -24,9 +24,7 @@ #ifndef nsFilePicker_h__ #define nsFilePicker_h__ -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" -#undef NS_IMPL_IDS #include "nsBaseFilePicker.h" #include "nsString.h" #include "nsdefs.h" diff --git a/mozilla/widget/src/gtk/nsClipboard.cpp b/mozilla/widget/src/gtk/nsClipboard.cpp index 2aaa3379095..39aa18e59c5 100644 --- a/mozilla/widget/src/gtk/nsClipboard.cpp +++ b/mozilla/widget/src/gtk/nsClipboard.cpp @@ -52,9 +52,7 @@ #include "prthread.h" // unicode conversion -#define NS_IMPL_IDS # include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS // The class statics: diff --git a/mozilla/widget/src/mac/nsMacControl.cpp b/mozilla/widget/src/mac/nsMacControl.cpp index 6f1e8e46523..3a7341d226e 100644 --- a/mozilla/widget/src/mac/nsMacControl.cpp +++ b/mozilla/widget/src/mac/nsMacControl.cpp @@ -46,9 +46,7 @@ #include "nsFontMetricsMac.h" #include "nsIServiceManager.h" -#define NS_IMPL_IDS #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #if TARGET_CARBON || (UNIVERSAL_INTERFACES_VERSION >= 0x0330) #include diff --git a/mozilla/widget/src/mac/nsMacControl.h b/mozilla/widget/src/mac/nsMacControl.h index dfad6948557..98d77e06227 100644 --- a/mozilla/widget/src/mac/nsMacControl.h +++ b/mozilla/widget/src/mac/nsMacControl.h @@ -39,9 +39,7 @@ #define nsMacControl_h__ #include "nsIServiceManager.h" -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" -#undef NS_IMPL_IDS #include "nsChildWindow.h" #include diff --git a/mozilla/widget/src/os2/nsFilePicker.cpp b/mozilla/widget/src/os2/nsFilePicker.cpp index afc25dc62a0..f063b3d05f5 100644 --- a/mozilla/widget/src/os2/nsFilePicker.cpp +++ b/mozilla/widget/src/os2/nsFilePicker.cpp @@ -30,9 +30,7 @@ #include "nsReadableUtils.h" #include "nsNetUtil.h" #include "nsIServiceManager.h" -#define NS_IMPL_IDS #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #include "nsWidgetDefs.h" #include "nsFilePicker.h" #include "nsILocalFile.h" diff --git a/mozilla/widget/src/os2/nsFilePicker.h b/mozilla/widget/src/os2/nsFilePicker.h index 1ab56ae3830..95a2a47af3a 100644 --- a/mozilla/widget/src/os2/nsFilePicker.h +++ b/mozilla/widget/src/os2/nsFilePicker.h @@ -24,9 +24,7 @@ #ifndef nsFilePicker_h__ #define nsFilePicker_h__ -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" -#undef NS_IMPL_IDS #include "nsBaseFilePicker.h" #include "nsString.h" #include "nsdefs.h" diff --git a/mozilla/widget/src/windows/nsFilePicker.cpp b/mozilla/widget/src/windows/nsFilePicker.cpp index dff23cff41e..262799d30ed 100644 --- a/mozilla/widget/src/windows/nsFilePicker.cpp +++ b/mozilla/widget/src/windows/nsFilePicker.cpp @@ -30,9 +30,7 @@ #include "nsReadableUtils.h" #include "nsNetUtil.h" #include "nsIServiceManager.h" -#define NS_IMPL_IDS #include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #include "nsFilePicker.h" #include "nsILocalFile.h" #include "nsIFileChannel.h" diff --git a/mozilla/widget/src/windows/nsFilePicker.h b/mozilla/widget/src/windows/nsFilePicker.h index 2a79076c3ea..e895205f307 100644 --- a/mozilla/widget/src/windows/nsFilePicker.h +++ b/mozilla/widget/src/windows/nsFilePicker.h @@ -27,9 +27,7 @@ #include "nsIFileChannel.h" #include "nsILocalFile.h" -#define NS_IMPL_IDS #include "nsICharsetConverterManager.h" -#undef NS_IMPL_IDS #include "nsBaseFilePicker.h" #include "nsString.h" #include "nsdefs.h" diff --git a/mozilla/widget/src/xlib/nsClipboard.cpp b/mozilla/widget/src/xlib/nsClipboard.cpp index b2c3ea6e501..380df8e3560 100644 --- a/mozilla/widget/src/xlib/nsClipboard.cpp +++ b/mozilla/widget/src/xlib/nsClipboard.cpp @@ -69,9 +69,7 @@ #include "nsIServiceManager.h" #include "nsICharsetConverterManager.h" // unicode conversion -#define NS_IMPL_IDS # include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS // The class statics: diff --git a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp index 8a82a157479..3edecf0948b 100644 --- a/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp +++ b/mozilla/widget/src/xpwidgets/nsPrimitiveHelpers.cpp @@ -46,9 +46,7 @@ #include "nsIServiceManager.h" #include "nsICharsetConverterManager.h" // unicode conversion -#define NS_IMPL_IDS # include "nsIPlatformCharset.h" -#undef NS_IMPL_IDS #include "nsISaveAsCharset.h" diff --git a/mozilla/xpcom/ds/nsObserver.cpp b/mozilla/xpcom/ds/nsObserver.cpp index 9360d177262..f1ff97df66b 100644 --- a/mozilla/xpcom/ds/nsObserver.cpp +++ b/mozilla/xpcom/ds/nsObserver.cpp @@ -36,7 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "pratom.h" #include "nsIFactory.h" #include "nsIServiceManager.h" diff --git a/mozilla/xpcom/ds/nsObserverList.cpp b/mozilla/xpcom/ds/nsObserverList.cpp index 3861045fec6..ee7a77be43e 100644 --- a/mozilla/xpcom/ds/nsObserverList.cpp +++ b/mozilla/xpcom/ds/nsObserverList.cpp @@ -37,7 +37,6 @@ #define NS_WEAK_OBSERVERS -#define NS_IMPL_IDS #include "pratom.h" #include "nsString.h" #include "nsAutoLock.h" diff --git a/mozilla/xpcom/ds/nsObserverService.cpp b/mozilla/xpcom/ds/nsObserverService.cpp index dacbb33461b..55c7aed8f1d 100644 --- a/mozilla/xpcom/ds/nsObserverService.cpp +++ b/mozilla/xpcom/ds/nsObserverService.cpp @@ -36,7 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "prlog.h" #include "prlock.h" #include "nsIFactory.h" diff --git a/mozilla/xpcom/ds/nsPersistentProperties.cpp b/mozilla/xpcom/ds/nsPersistentProperties.cpp index 6fad960e149..3d058b3486a 100644 --- a/mozilla/xpcom/ds/nsPersistentProperties.cpp +++ b/mozilla/xpcom/ds/nsPersistentProperties.cpp @@ -36,8 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "nsPersistentProperties.h" #include "nsID.h" #include "nsCRT.h" diff --git a/mozilla/xpcom/ds/nsProperties.cpp b/mozilla/xpcom/ds/nsProperties.cpp index dea77e18a7a..e2e21c3a088 100644 --- a/mozilla/xpcom/ds/nsProperties.cpp +++ b/mozilla/xpcom/ds/nsProperties.cpp @@ -35,8 +35,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - #include "nsProperties.h" //#include diff --git a/mozilla/xpcom/io/nsFileSpec.cpp b/mozilla/xpcom/io/nsFileSpec.cpp index 4d4b70d4ce3..1645c2fc384 100644 --- a/mozilla/xpcom/io/nsFileSpec.cpp +++ b/mozilla/xpcom/io/nsFileSpec.cpp @@ -48,7 +48,6 @@ #include "nsCOMPtr.h" #include "nsIServiceManager.h" -#define NS_IMPL_IDS #include #include diff --git a/mozilla/xpcom/tests/PropertiesTest.cpp b/mozilla/xpcom/tests/PropertiesTest.cpp index 5fa880e8b99..17e7e572a72 100644 --- a/mozilla/xpcom/tests/PropertiesTest.cpp +++ b/mozilla/xpcom/tests/PropertiesTest.cpp @@ -37,7 +37,6 @@ * ***** END LICENSE BLOCK ***** */ #ifndef XPCOM_STANDALONE -#define NS_IMPL_IDS #include "nsXPCOM.h" #include "nsIEventQueueService.h" diff --git a/mozilla/xpcom/tests/TestObserverService.cpp b/mozilla/xpcom/tests/TestObserverService.cpp index f22fa0bec31..de485e9f1fd 100644 --- a/mozilla/xpcom/tests/TestObserverService.cpp +++ b/mozilla/xpcom/tests/TestObserverService.cpp @@ -36,7 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS #include "nsISupports.h" #include "nsIComponentManager.h" #include "nsIObserverService.h" diff --git a/mozilla/xpcom/tests/TestServMgr.cpp b/mozilla/xpcom/tests/TestServMgr.cpp index dec471e5a21..c3639737079 100644 --- a/mozilla/xpcom/tests/TestServMgr.cpp +++ b/mozilla/xpcom/tests/TestServMgr.cpp @@ -37,6 +37,7 @@ * ***** END LICENSE BLOCK ***** */ #include "MyService.h" +#include "nsXPCOM.h" #include "nsIServiceManager.h" #include "nsIComponentManager.h" #include @@ -143,30 +144,17 @@ AsyncNoShutdownTest(int testNumber) } //////////////////////////////////////////////////////////////////////////////// -#if defined(XP_WIN32) || defined(XP_OS2_VACPP) -#define _MY_SERVICE_DLL "rel:MyService.dll" -#else -#define _MY_SERVICE_DLL "rel:libMyService" MOZ_DLL_SUFFIX -#endif - -void -SetupFactories(void) -{ - nsresult err; - // seed the repository (hack) - err = nsComponentManager::RegisterComponent(kIMyServiceCID, NULL, NULL, - _MY_SERVICE_DLL, - PR_TRUE, PR_FALSE); - NS_ASSERTION(err == NS_OK, "failed to register my factory"); -} - int main(void) { nsresult err; int testNumber = 0; - SetupFactories(); + err = NS_InitXPCOM2(nsnull, nsnull, nsnull); + if (NS_FAILED(err)) { + printf("NS_InitXPCOM2 failed\n"); + return -1; + } err = SimpleTest(++testNumber); if (err != NS_OK) diff --git a/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp b/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp index 7920643fc21..b74e9fa043c 100644 --- a/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp +++ b/mozilla/xpfe/components/bookmarks/src/nsBookmarksService.cpp @@ -37,8 +37,6 @@ * * ***** END LICENSE BLOCK ***** */ -#define NS_IMPL_IDS - /* The global bookmarks service. */