From 4b0f6c610f755e0cb93843d5a2a6c70336eafe39 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 1 Oct 2006 14:59:38 +0000 Subject: Now with binary versioning goodness git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5366 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/inspircd.cpp') 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 :/ */ -- cgit v1.2.3