X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=include%2Fmodules.h;h=ef2e4b0e46cbd8981e5d7ea2b34bac1d100e0d51;hb=8c2d96013084de950e3a63be4ae6ed626c4093ab;hp=7b1ee43b480721aa733f4d0d88e685962fe8d3f3;hpb=3039e0663f7e45a45e9574a6aa7463bbe77e849f;p=user%2Fhenk%2Fcode%2Finspircd.git 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