NSGetStaticModuleInfo = apprunner_getModuleInfo;
NSGetStaticModuleInfo = app_getModuleInfo;
int main(int argc, char* argv[]){  NS_TIMELINE_MARK("enter main");#if defined(XP_UNIX) || defined(XP_BEOS)  InstallUnixSignalHandlers(argv[0]);#endif#if defined(XP_OS2)  __argc = argc;  __argv = argv;#endif /* XP_OS2 */#if defined(XP_BEOS)  if (NS_OK != InitializeBeOSApp())    return 1;#endif#if defined(XP_MACOSX)  InitializeMacOSXApp(argc, argv);#endif#ifdef _BUILD_STATIC_BIN  // Initialize XPCOM's module info table  NSGetStaticModuleInfo = apprunner_getModuleInfo;#endif  // Handle -help and -version command line arguments.  // They should% return quick, so we deal with them here.  if (HandleDumpArguments(argc, argv))    return 0;#ifdef NS_TRACE_MALLOC  argc = NS_TraceMallocStartupArgs(argc, argv);#endif  // Call the code to install our handler#ifdef MOZ_JPROF  setupProfilingStuff();#endif  // Try to allocate "native app support."  // Note: this object is not released here.  It is passed to main1 which  //       has responsibility to release it.  nsINativeAppSupport *nativeApp = 0;  nsresult rv = NS_CreateNativeAppSupport( &nativeApp );  // See if we can run.  if (nativeApp)  {    PRBool canRun = PR_FALSE;    rv = nativeApp->Start( &canRun );    if (!canRun) {        return 1;    }  } else {    // If platform doesn't implement nsINativeAppSupport, fall    // back to old method.    if (!NS_CanRun())      return 1;  }  // Note: this object is not released here.  It is passed to main1 which  //       has responsibility to release it.  nsISplashScreen *splash = 0;  PRBool dosplash = GetWantSplashScreen(argc, argv);  if (dosplash && !nativeApp) {    // If showing splash screen and platform doesn't implement    // nsINativeAppSupport, then use older nsISplashScreen interface.    rv = NS_CreateSplashScreen(&splash);    NS_ASSERTION( NS_SUCCEEDED(rv), "NS_CreateSplashScreen failed" );  }  // If the platform has a splash screen, show it ASAP.  if (dosplash && nativeApp) {    nativeApp->ShowSplashScreen();  } else if (splash) {    splash->Show();  }  NS_TIMELINE_MARK("InitXPCom...");  rv = NS_InitXPCOM2(NULL, NULL, NULL);  NS_ASSERTION( NS_SUCCEEDED(rv), "NS_InitXPCOM failed" );  NS_TIMELINE_MARK("...InitXPCOM done");#ifdef MOZ_ENABLE_XREMOTE  // handle -remote now that xpcom is fired up  int remoterv;  PRBool argused = PR_FALSE;  // argused will be true if someone tried to use a -remote flag.  We  // always exit in that case.  remoterv = HandleRemoteArguments(argc, argv, &argused);  if (argused) {    NS_ShutdownXPCOM(NULL);    return remoterv;  }#endif  nsresult mainResult = main1(argc, argv, nativeApp ? (nsISupports*)nativeApp : (nsISupports*)splash);  /* if main1() didn't succeed, then don't bother trying to shut down clipboard, etc */  if (NS_SUCCEEDED(mainResult)) {    rv = DoOnShutdown();    NS_ASSERTION(NS_SUCCEEDED(rv), "DoOnShutdown failed");  }  rv = NS_ShutdownXPCOM( NULL );  NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed");  return TranslateReturnValue(mainResult);}