diff options
Diffstat (limited to 'include/modules.h')
-rw-r--r-- | include/modules.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/modules.h b/include/modules.h index 7b1ee43b4..ef2e4b0e4 100644 --- a/include/modules.h +++ b/include/modules.h @@ -1862,10 +1862,31 @@ class CoreExport ModuleManager : public classbase * and functions needed to make a module loadable by the OS. * It defines the class factory and external init_module function. */ +#ifdef WINDOWS + #define MODULE_INIT(y) \ extern "C" DllExport Module * init_module(InspIRCd* Me) \ { \ return new y(Me); \ + } \ + BOOLEAN WINAPI DllMain(HINSTANCE hDllHandle, DWORD nReason, LPVOID Reserved) \ + { \ + switch ( nReason ) \ + { \ + case DLL_PROCESS_ATTACH: \ + case DLL_PROCESS_DETACH: \ + break; \ + } \ + return TRUE; \ } +#else + +#define MODULE_INIT(y) \ + extern "C" DllExport Module * init_module(InspIRCd* Me) \ + { \ + return new y(Me); \ + } +#endif + #endif |