diff options
author | DukePyrolator <DukePyrolator@anope.org> | 2011-03-13 03:42:30 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-03-13 03:42:30 -0400 |
commit | 3fbf39b25d3ab95cab83baf198a24a7d6ad3689b (patch) | |
tree | 0b785f887b531ace1649ed019836b04954f3b460 /src/modules.cpp | |
parent | 15a833283b0ec501f8c986b269b8360c6aa923f9 (diff) |
Added some useful Anope::Version functions to prevent some files from unnecessarily rebuilding on every make
Diffstat (limited to 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 51ae4acb9..cebe58987 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -10,7 +10,6 @@ */ #include "modules.h" -#include "version.h" message_map MessageMap; std::list<Module *> Modules; @@ -196,27 +195,27 @@ int Module::DelCommand(BotInfo *bi, Command *c) bool moduleMinVersion(int major, int minor, int patch, int build) { bool ret = false; - if (VERSION_MAJOR > major) /* Def. new */ + if (Anope::VersionMajor() > major) /* Def. new */ ret = true; - else if (VERSION_MAJOR == major) /* Might be newer */ + else if (Anope::VersionMajor() == major) /* Might be newer */ { if (minor == -1) return true; /* They dont care about minor */ - if (VERSION_MINOR > minor) /* Def. newer */ + if (Anope::VersionMinor() > minor) /* Def. newer */ ret = true; - else if (VERSION_MINOR == minor) /* Might be newer */ + else if (Anope::VersionMinor() == minor) /* Might be newer */ { if (patch == -1) return true; /* They dont care about patch */ - if (VERSION_PATCH > patch) + if (Anope::VersionPatch() > patch) ret = true; - else if (VERSION_PATCH == patch) + else if (Anope::VersionPatch() == patch) { #if 0 // XXX if (build == -1) return true; /* They dont care about build */ - if (VERSION_BUILD >= build) + if (Anope::VersionBuild >= build) ret = true; #endif } @@ -280,11 +279,6 @@ void ModuleRunTimeDirCleanUp() Log(LOG_DEBUG) << "Module run time directory has been cleaned out"; } -Version Module::GetVersion() const -{ - return Version(VERSION_MAJOR, VERSION_MINOR, VERSION_BUILD); -} - void Module::SendMessage(CommandSource &source, const char *fmt, ...) { Anope::string language = (source.u && source.u->Account() ? source.u->Account()->language : ""); |