extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr, nsIFileSpec* location, nsIModule** return_cobj) { nsresult rv = NS_OK;  NS_ASSERTION(return_cobj, "Null argument"); NS_ASSERTION(gModule == NULL, "nsLWBrkModule: Module already created.");   nsLWBrkModule *m = new nsLWBrkModule(); if (!m) { return NS_ERROR_OUT_OF_MEMORY; }   rv = m->QueryInterface(nsIModule::GetIID(), (void**)return_cobj); if (NS_FAILED(rv)) { delete m; m = nsnull; } gModule = m; return rv; }
NS_IMPL_NSGETMODULE("nsLWBrkModule", components);
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,                                          nsIFileSpec* location,                                          nsIModule** return_cobj){  nsresult rv = NS_OK;  NS_ASSERTION(return_cobj, "Null argument");  NS_ASSERTION(gModule == NULL, "nsLWBrkModule: Module already created.");  // Create an initialize the layout module instance  nsLWBrkModule *m = new nsLWBrkModule();  if (!m) {    return NS_ERROR_OUT_OF_MEMORY;  }  // Increase refcnt and store away nsIModule interface to m in return_cobj  rv = m->QueryInterface(nsIModule::GetIID(), (void**)return_cobj);  if (NS_FAILED(rv)) {    delete m;    m = nsnull;  }  gModule = m;                  // WARNING: Weak Reference  return rv;}