diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-16 22:17:28 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-04-16 22:17:28 +0000 |
commit | 94f2293f6566200f4d5ae359b7b60121737e145b (patch) | |
tree | 7e596a5e545931de3b732a5aa770a5f37480864e | |
parent | 024e7c12f562f99c2c03c6c3b7e8ffc9432f3d8d (diff) |
Implement our own dllmain. if this works and gets rid of error at 70 modules, i will backport it
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9521 e03df62e-2008-0410-955e-edbf42e46eb7
-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 |