diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-01 14:59:38 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-10-01 14:59:38 +0000 |
commit | 4b0f6c610f755e0cb93843d5a2a6c70336eafe39 (patch) | |
tree | f0faea2448362629d3f82cb67d4f74242ec36dcf /src/inspircd.cpp | |
parent | abec4e1e7c76cb8fa1b324d9ca743e7d687a9b09 (diff) |
Now with binary versioning goodness
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5366 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 25acba68f..6801700f1 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -566,6 +566,18 @@ bool InspIRCd::LoadModule(const char* filename) if ((long)factory[this->ModCount+1]->factory != -1) { Module* m = factory[this->ModCount+1]->factory->CreateModule(this); + + Version v = m->GetVersion(); + + if (v.API != API_VERSION) + { + delete m; + delete a; + this->Log(DEFAULT,"Unable to load %s: Incorrect module API version: %d (our version: %d)",modfile,v.API,API_VERSION); + snprintf(MODERR,MAXBUF,"Loader/Linker error: Incorrect module API version: %d (our version: %d)",v.API,API_VERSION); + return false; + } + modules[this->ModCount+1] = m; /* save the module and the module's classfactory, if * this isnt done, random crashes can occur :/ */ |