-
-/** Do not mess with these functions unless you know the C preprocessor
- * well enough to explain why they are needed. The order is important.
- */
-#define MODULE_INIT_STR MODULE_INIT_STR_FN_2(MODULE_INIT_SYM)
-#define MODULE_INIT_STR_FN_2(x) MODULE_INIT_STR_FN_1(x)
-#define MODULE_INIT_STR_FN_1(x) #x
-#define MODULE_INIT_SYM MODULE_INIT_SYM_FN_2(INSPIRCD_VERSION_MAJ, INSPIRCD_VERSION_API)
-#define MODULE_INIT_SYM_FN_2(x,y) MODULE_INIT_SYM_FN_1(x,y)
-#define MODULE_INIT_SYM_FN_1(x,y) inspircd_module_ ## x ## _ ## y
-
-#ifdef INSPIRCD_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, MODNAME ".so");
-
-#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.
- */
-#define MODULE_INIT(y) \
- extern "C" DllExport Module * MODULE_INIT_SYM() \
- { \
- return new y; \
- } \
- extern "C" DllExport const char inspircd_src_version[] = INSPIRCD_VERSION;
-
-#define COMMAND_INIT(c) MODULE_INIT(CommandModule<c>)
-
-#endif