summaryrefslogtreecommitdiff
path: root/include/modules.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/modules.h')
-rw-r--r--include/modules.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/include/modules.h b/include/modules.h
index 5ea35c888..0c10caa7b 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -20,6 +20,7 @@
#include "timers.h"
#include "logger.h"
#include "extensible.h"
+#include "version.h"
/** This definition is used as shorthand for the various classes
* and functions needed to make a module loadable by the OS.
@@ -40,6 +41,10 @@
extern "C" void AnopeFini(x *m) \
{ \
delete m; \
+ } \
+ extern "C" DllExport ModuleVersion AnopeVersion() \
+ { \
+ return ModuleVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); \
}
#else
# define MODULE_INIT(x) \
@@ -50,6 +55,10 @@
extern "C" DllExport void AnopeFini(x *m) \
{ \
delete m; \
+ } \
+ extern "C" DllExport ModuleVersion AnopeVersion() \
+ { \
+ return ModuleVersion(VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); \
}
#endif
@@ -279,12 +288,6 @@ class CoreExport Module : public Extensible
*/
void SetAuthor(const Anope::string &author);
- /** Get the version of Anope this module was
- * compiled against
- * @return The version
- */
- ModuleVersion GetVersion() const;
-
virtual void Prioritize();
/* Everything below here are events. Modules must ModuleManager::Attach to these events
@@ -1206,6 +1209,11 @@ class CoreExport ModuleManager
* @return MOD_ERR_OK on success, anything else on fail
*/
static ModuleReturn DeleteModule(Module *m);
+
+ /** Get the version of Anope the module was compiled against
+ * @return The version
+ */
+ static ModuleVersion GetVersion(void *handle);
};
#endif // MODULES_H