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, "nsUcharUtilModule: Module already created.");   nsUcharUtilModule *m = new nsUcharUtilModule(); if (!m) { return NS_ERROR_OUT_OF_MEMORY; }   rv = m->QueryInterface(NS_GET_IID(nsIModule), (void**)return_cobj); if (NS_FAILED(rv)) { delete m; m = nsnull; } gModule = m; return rv; }
NS_IMPL_NSGETMODULE("UcharUtil", 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, "nsUcharUtilModule: Module already created.");    // Create and initialize the module instance    nsUcharUtilModule *m = new nsUcharUtilModule();    if (!m) {        return NS_ERROR_OUT_OF_MEMORY;    }    // Increase refcnt and store away nsIModule interface to m in return_cobj    rv = m->QueryInterface(NS_GET_IID(nsIModule), (void**)return_cobj);    if (NS_FAILED(rv)) {        delete m;        m = nsnull;    }    gModule = m;                  // WARNING: Weak Reference    return rv;}