X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fdynamic.cpp;h=5f69820c9ec84805a1bae24f9f7009c193bc392f;hb=7b1ab06a9551d8db141ebc9213836af6b5369284;hp=a3ba43ff24a8045c454ae88fefe16d18ec8d26b1;hpb=aed712ba8e087232fcd9f71db4311687a7ce4398;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/dynamic.cpp b/src/dynamic.cpp index a3ba43ff2..5f69820c9 100644 --- a/src/dynamic.cpp +++ b/src/dynamic.cpp @@ -1,7 +1,8 @@ /* * InspIRCd -- Internet Relay Chat Daemon * - * Copyright (C) 2017-2019 Sadie Powell + * Copyright (C) 2020 Matt Schatz + * Copyright (C) 2017-2020 Sadie Powell * Copyright (C) 2014 Attila Molnar * Copyright (C) 2012 Robby * Copyright (C) 2012 ChrisTX @@ -9,7 +10,7 @@ * Copyright (C) 2009 Uli Schlachter * Copyright (C) 2007 Robin Burchell * Copyright (C) 2007 Dennis Friis - * Copyright (C) 2006, 2010 Craig Edwards + * Copyright (C) 2003, 2006, 2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -60,7 +61,7 @@ DLLManager::~DLLManager() return; #ifdef _WIN32 - FreeLibrary(lib) + FreeLibrary(lib); #else dlclose(lib); #endif @@ -68,7 +69,10 @@ DLLManager::~DLLManager() Module* DLLManager::CallInit() { - const uint32_t* abi = GetSymbol(MODULE_STR_ABI); + if (!lib) + return NULL; + + const unsigned long* abi = GetSymbol(MODULE_STR_ABI); if (!abi) { err.assign(libname + " is not a module (no ABI symbol)"); @@ -77,9 +81,9 @@ Module* DLLManager::CallInit() else if (*abi != MODULE_ABI) { const char* version = GetVersion(); - err.assign(InspIRCd::Format("%s was built against %s which is too %s to use with %s", - libname.c_str(), version ? version : "an unknown version", - *abi < MODULE_ABI ? "old" : "new", INSPIRCD_VERSION)); + err.assign(InspIRCd::Format("%s was built against %s (%lu) which is too %s to use with %s (%lu).", + libname.c_str(), version ? version : "an unknown version", *abi, + *abi < MODULE_ABI ? "old" : "new", INSPIRCD_VERSION, MODULE_ABI)); return NULL; }