diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-11-11 00:17:07 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2009-11-11 00:17:07 +0000 |
commit | 19487dbebc520450e457472b97d9e7bcd5160c00 (patch) | |
tree | 5ba36439139db77ff11c549228a3dbf69727e9cc /include | |
parent | 316167b91713739d784cc4c640275ebe2a9f054a (diff) |
Allow static build of inspircd without module support
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12083 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'include')
-rw-r--r-- | include/modules.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/include/modules.h b/include/modules.h index dc59abdd9..3efee83dc 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1696,6 +1696,28 @@ class CoreExport ModuleManager #define MODULE_INIT_SYM_FN_2(x) MODULE_INIT_SYM_FN_1(x) #define MODULE_INIT_SYM_FN_1(x) inspircd_module_ ## x +#ifdef PURE_STATIC + +struct AllCommandList { + typedef Command* (*fn)(Module*); + AllCommandList(fn cmd); +}; +#define COMMAND_INIT(x) static Command* MK_ ## x(Module* m) { return new x(m); } \ + static const AllCommandList PREP_ ## x(&MK_ ## x); + +struct AllModuleList { + typedef Module* (*fn)(); + fn init; + std::string name; + AllModuleList(fn mod, const std::string& Name); +}; + +#define MODULE_INIT(x) static Module* MK_ ## x() { return new x; } \ + static const AllModuleList PREP_ ## x(&MK_ ## x, #x); + + +#else + /** This definition is used as shorthand for the various classes * and functions needed to make a module loadable by the OS. * It defines the class factory and external init_module function. @@ -1730,3 +1752,5 @@ class CoreExport ModuleManager #define COMMAND_INIT(c) MODULE_INIT(CommandModule<c>) #endif + +#endif |