]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Include the ABI version with the incompatible module error message.
authorSadie Powell <sadie@witchery.services>
Mon, 3 Feb 2020 21:43:15 +0000 (21:43 +0000)
committerSadie Powell <sadie@witchery.services>
Tue, 4 Feb 2020 11:56:00 +0000 (11:56 +0000)
include/moduledefs.h
src/dynamic.cpp

index a2bac63cb714db6650f56471fb82ec979c289d5c..4b917bf26b7ed499872a38d77ac37a9a087fe8a2 100644 (file)
@@ -22,7 +22,7 @@
 class Module;
 
 /** The version of the InspIRCd ABI which is presently in use. */
-#define MODULE_ABI 3010
+#define MODULE_ABI 3010UL
 
 /** Stringifies the value of a symbol. */
 #define MODULE_STRINGIFY_SYM1(DEF) MODULE_STRINGIFY_SYM2(DEF)
@@ -42,6 +42,6 @@ class Module;
 
 /** Defines the interface that a shared library must expose in order to be a module. */
 #define MODULE_INIT(klass) \
-       extern "C" DllExport const uint32_t MODULE_SYM_ABI = MODULE_ABI; \
+       extern "C" DllExport const unsigned long MODULE_SYM_ABI = MODULE_ABI; \
        extern "C" DllExport const char MODULE_SYM_VERSION[] = INSPIRCD_VERSION; \
        extern "C" DllExport Module* MODULE_SYM_INIT() { return new klass; }
index a3ba43ff24a8045c454ae88fefe16d18ec8d26b1..e0d7f6d80f67d243b1b306cfe8334463b9235124 100644 (file)
@@ -68,7 +68,7 @@ DLLManager::~DLLManager()
 
 Module* DLLManager::CallInit()
 {
-       const uint32_t* abi = GetSymbol<const uint32_t>(MODULE_STR_ABI);
+       const unsigned long* abi = GetSymbol<const unsigned long>(MODULE_STR_ABI);
        if (!abi)
        {
                err.assign(libname + " is not a module (no ABI symbol)");
@@ -77,9 +77,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;
        }