diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-19 15:56:42 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-05-19 15:56:42 +0000 |
commit | 9cf56d917d92959701694477f7944d45ad2c38ed (patch) | |
tree | a379ee905e7485c2ee825790720ed2b69ba127d1 /src/modules | |
parent | 3bbb36695383badf5b3ba0ecba070f16094ae51d (diff) |
Windows support. Tested and working to compile on freebsd and linux. Next step is to make sure it actually works in windows too. ;p. Add Burlex to contributors.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7043 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules')
115 files changed, 283 insertions, 250 deletions
diff --git a/src/modules/extra/m_ssl_gnutls.cpp b/src/modules/extra/m_ssl_gnutls.cpp index 5d95e75cf..436b0f364 100644 --- a/src/modules/extra/m_ssl_gnutls.cpp +++ b/src/modules/extra/m_ssl_gnutls.cpp @@ -29,6 +29,12 @@ #include "transport.h" +#ifdef WINDOWS +#pragma comment(lib, "libgnutls-13.lib") +#undef MAX_DESCRIPTORS +#define MAX_DESCRIPTORS 10000 +#endif + /* $ModDesc: Provides SSL support for clients */ /* $CompileFlags: exec("libgnutls-config --cflags") */ /* $LinkerFlags: rpath("libgnutls-config --libs") exec("libgnutls-config --libs") */ @@ -85,7 +91,7 @@ class ModuleSSLGnuTLS : public Module public: ModuleSSLGnuTLS(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ServerInstance->PublishInterface("InspSocketHook", this); @@ -837,7 +843,7 @@ class ModuleSSLGnuTLSFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSSLGnuTLSFactory; } diff --git a/src/modules/extra/m_ssl_openssl.cpp b/src/modules/extra/m_ssl_openssl.cpp index e073eba81..90e9c9ab6 100644 --- a/src/modules/extra/m_ssl_openssl.cpp +++ b/src/modules/extra/m_ssl_openssl.cpp @@ -17,6 +17,10 @@ #include <openssl/ssl.h> #include <openssl/err.h> +#ifdef WINDOWS +#include <openssl/applink.c> +#endif + #include "inspircd_config.h" #include "configreader.h" #include "users.h" @@ -29,6 +33,13 @@ #include "transport.h" +#ifdef WINDOWS +#pragma comment(lib, "libeay32MTd") +#pragma comment(lib, "ssleay32MTd") +#undef MAX_DESCRIPTORS +#define MAX_DESCRIPTORS 10000 +#endif + /* $ModDesc: Provides SSL support for clients */ /* $CompileFlags: pkgconfversion("openssl","0.9.7") pkgconfincludes("openssl","/openssl/ssl.h","") */ /* $LinkerFlags: rpath("pkg-config --libs openssl") pkgconflibs("openssl","/libssl.so","-lssl -lcrypto -ldl") */ @@ -122,7 +133,7 @@ class ModuleSSLOpenSSL : public Module InspIRCd* PublicInstance; ModuleSSLOpenSSL(InspIRCd* Me) - : Module::Module(Me), PublicInstance(Me) + : Module(Me), PublicInstance(Me) { ServerInstance->PublishInterface("InspSocketHook", this); @@ -855,7 +866,7 @@ class ModuleSSLOpenSSLFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSSLOpenSSLFactory; } diff --git a/src/modules/m_alias.cpp b/src/modules/m_alias.cpp index a901ab165..827aeaf30 100644 --- a/src/modules/m_alias.cpp +++ b/src/modules/m_alias.cpp @@ -75,7 +75,7 @@ class ModuleAlias : public Module public: ModuleAlias(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ReadAliases(); pars.resize(127); @@ -289,7 +289,7 @@ class ModuleAliasFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleAliasFactory; } diff --git a/src/modules/m_alltime.cpp b/src/modules/m_alltime.cpp index 04ae63b17..a24e3c979 100644 --- a/src/modules/m_alltime.cpp +++ b/src/modules/m_alltime.cpp @@ -64,7 +64,7 @@ class Modulealltime : public Module cmd_alltime *mycommand; public: Modulealltime(InspIRCd *Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_alltime(ServerInstance); ServerInstance->AddCommand(mycommand); @@ -99,7 +99,7 @@ class ModulealltimeFactory : public ModuleFactory }; -extern "C" void *init_module(void) +extern "C" DllExport void *init_module(void) { return new ModulealltimeFactory; } diff --git a/src/modules/m_antibear.cpp b/src/modules/m_antibear.cpp index 90e515d33..f0affea7e 100644 --- a/src/modules/m_antibear.cpp +++ b/src/modules/m_antibear.cpp @@ -24,7 +24,7 @@ class ModuleAntiBear : public Module private: public: - ModuleAntiBear(InspIRCd* Me) : Module::Module(Me) + ModuleAntiBear(InspIRCd* Me) : Module(Me) { } @@ -99,7 +99,7 @@ class ModuleAntiBearFactory : public ModuleFactory // class for this library // -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleAntiBearFactory; } diff --git a/src/modules/m_antibottler.cpp b/src/modules/m_antibottler.cpp index 27225edac..93a5691ef 100644 --- a/src/modules/m_antibottler.cpp +++ b/src/modules/m_antibottler.cpp @@ -22,7 +22,7 @@ class ModuleAntiBottler : public Module { public: ModuleAntiBottler(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { } @@ -116,7 +116,7 @@ class ModuleAntiBottlerFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleAntiBottlerFactory; } diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp index 166d1bcc4..15ef1943e 100644 --- a/src/modules/m_auditorium.cpp +++ b/src/modules/m_auditorium.cpp @@ -54,7 +54,7 @@ class ModuleAuditorium : public Module CUList except_list; public: ModuleAuditorium(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { aum = new AuditoriumMode(ServerInstance); if (!ServerInstance->AddMode(aum, 'u')) @@ -206,7 +206,7 @@ class ModuleAuditoriumFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleAuditoriumFactory; } diff --git a/src/modules/m_banexception.cpp b/src/modules/m_banexception.cpp index a340a5ce7..3fc192cb5 100644 --- a/src/modules/m_banexception.cpp +++ b/src/modules/m_banexception.cpp @@ -49,7 +49,7 @@ class ModuleBanException : public Module public: ModuleBanException(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { be = new BanException(ServerInstance); if (!ServerInstance->AddMode(be, 'e')) @@ -170,7 +170,7 @@ class ModuleBanExceptionFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleBanExceptionFactory; } diff --git a/src/modules/m_banredirect.cpp b/src/modules/m_banredirect.cpp index 2d9deedc6..ffe7724e2 100644 --- a/src/modules/m_banredirect.cpp +++ b/src/modules/m_banredirect.cpp @@ -191,7 +191,7 @@ class ModuleBanRedirect : public Module public: ModuleBanRedirect(InspIRCd* Me) - : Module::Module(Me), Srv(Me) + : Module(Me), Srv(Me) { re = new BanRedirect(Me); nofollow = false; @@ -337,7 +337,7 @@ class ModuleBanRedirectFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleBanRedirectFactory; } diff --git a/src/modules/m_blockamsg.cpp b/src/modules/m_blockamsg.cpp index 39e3c16b1..f1a388890 100644 --- a/src/modules/m_blockamsg.cpp +++ b/src/modules/m_blockamsg.cpp @@ -45,7 +45,7 @@ class ModuleBlockAmsg : public Module int ForgetDelay; BlockAction action; public: - ModuleBlockAmsg(InspIRCd* Me) : Module::Module(Me) + ModuleBlockAmsg(InspIRCd* Me) : Module(Me) { this->OnRehash(NULL,""); @@ -192,7 +192,7 @@ class ModuleBlockAmsgFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleBlockAmsgFactory; } diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index e984087d8..a3991177b 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -58,7 +58,7 @@ class ModuleBlockCAPS : public Module char capsmap[256]; public: - ModuleBlockCAPS(InspIRCd* Me) : Module::Module(Me) + ModuleBlockCAPS(InspIRCd* Me) : Module(Me) { OnRehash(NULL,""); bc = new BlockCaps(ServerInstance); @@ -160,7 +160,7 @@ class ModuleBlockCAPSFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleBlockCAPSFactory; } diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index 219637fb9..c63a44ea7 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -56,7 +56,7 @@ class ModuleBlockColour : public Module BlockColor *bc; public: - ModuleBlockColour(InspIRCd* Me) : Module::Module(Me) + ModuleBlockColour(InspIRCd* Me) : Module(Me) { bc = new BlockColor(ServerInstance); if (!ServerInstance->AddMode(bc, 'c')) @@ -137,7 +137,7 @@ class ModuleBlockColourFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleBlockColourFactory; } diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index ea6d1e60a..a4cebc4c7 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -57,7 +57,7 @@ class ModuleBotMode : public Module BotMode* bm; public: ModuleBotMode(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { bm = new BotMode(ServerInstance); @@ -112,7 +112,7 @@ class ModuleBotModeFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleBotModeFactory; } diff --git a/src/modules/m_cban.cpp b/src/modules/m_cban.cpp index e6e3b92b0..9aaf5fc6d 100644 --- a/src/modules/m_cban.cpp +++ b/src/modules/m_cban.cpp @@ -127,7 +127,7 @@ class ModuleCBan : public Module public: - ModuleCBan(InspIRCd* Me) : Module::Module(Me) + ModuleCBan(InspIRCd* Me) : Module(Me) { mycommand = new cmd_cban(Me); @@ -266,7 +266,7 @@ class ModuleCBanFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleCBanFactory; } diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp index c378080a5..ae254a120 100644 --- a/src/modules/m_censor.cpp +++ b/src/modules/m_censor.cpp @@ -92,7 +92,7 @@ class ModuleCensor : public Module public: ModuleCensor(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { /* Read the configuration file on startup. */ @@ -213,7 +213,7 @@ class ModuleCensorFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleCensorFactory; } diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp index b3cc24839..671588d18 100644 --- a/src/modules/m_cgiirc.cpp +++ b/src/modules/m_cgiirc.cpp @@ -14,13 +14,15 @@ #include <vector> #include <string> #include <stdlib.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> #include "users.h" #include "modules.h" #include "dns.h" #include "inspircd.h" +#ifndef WINDOWS +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#endif /* $ModDesc: Change user's hosts connecting from known CGI:IRC hosts */ @@ -127,7 +129,7 @@ class ModuleCgiIRC : public Module bool NotifyOpers; CGIHostlist Hosts; public: - ModuleCgiIRC(InspIRCd* Me) : Module::Module(Me) + ModuleCgiIRC(InspIRCd* Me) : Module(Me) { OnRehash(NULL,""); @@ -518,7 +520,7 @@ class ModuleCgiIRCFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleCgiIRCFactory; } diff --git a/src/modules/m_chancreate.cpp b/src/modules/m_chancreate.cpp index e9e95a924..1efdf2996 100644 --- a/src/modules/m_chancreate.cpp +++ b/src/modules/m_chancreate.cpp @@ -23,7 +23,7 @@ class ModuleChanCreate : public Module private: public: ModuleChanCreate(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ServerInstance->SNO->EnableSnomask('j', "CHANCREATE"); } @@ -70,7 +70,7 @@ class ModuleChanCreateFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleChanCreateFactory; } diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index 3c16b013d..4008eb349 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -67,7 +67,7 @@ class ModuleChanFilter : public Module public: ModuleChanFilter(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { cf = new ChanFilter(ServerInstance); if (!ServerInstance->AddMode(cf, 'g')) @@ -172,7 +172,7 @@ class ModuleChanFilterFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleChanFilterFactory; } diff --git a/src/modules/m_chanprotect.cpp b/src/modules/m_chanprotect.cpp index 81cf34c0c..5ba18a2bf 100644 --- a/src/modules/m_chanprotect.cpp +++ b/src/modules/m_chanprotect.cpp @@ -303,7 +303,7 @@ class ModuleChanProtect : public Module public: ModuleChanProtect(InspIRCd* Me) - : Module::Module(Me), FirstInGetsFounder(false), QAPrefixes(false), DeprivSelf(false), DeprivOthers(false), booting(true) + : Module(Me), FirstInGetsFounder(false), QAPrefixes(false), DeprivSelf(false), DeprivOthers(false), booting(true) { /* Load config stuff */ OnRehash(NULL,""); @@ -548,7 +548,7 @@ class ModuleChanProtectFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleChanProtectFactory; } diff --git a/src/modules/m_check.cpp b/src/modules/m_check.cpp index 7a7fe570b..d12513af9 100644 --- a/src/modules/m_check.cpp +++ b/src/modules/m_check.cpp @@ -162,7 +162,7 @@ class ModuleCheck : public Module private: cmd_check *mycommand; public: - ModuleCheck(InspIRCd* Me) : Module::Module(Me) + ModuleCheck(InspIRCd* Me) : Module(Me) { mycommand = new cmd_check(ServerInstance); @@ -205,7 +205,7 @@ class ModuleCheckFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleCheckFactory; } diff --git a/src/modules/m_chghost.cpp b/src/modules/m_chghost.cpp index 45eaaa378..f3f7f6387 100644 --- a/src/modules/m_chghost.cpp +++ b/src/modules/m_chghost.cpp @@ -78,7 +78,7 @@ class ModuleChgHost : public Module char hostmap[256]; public: ModuleChgHost(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { OnRehash(NULL,""); mycommand = new cmd_chghost(ServerInstance, hostmap); @@ -134,7 +134,7 @@ class ModuleChgHostFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleChgHostFactory; } diff --git a/src/modules/m_chgident.cpp b/src/modules/m_chgident.cpp index 43bb34b31..8c251b2bc 100644 --- a/src/modules/m_chgident.cpp +++ b/src/modules/m_chgident.cpp @@ -60,7 +60,7 @@ class ModuleChgIdent : public Module public: - ModuleChgIdent(InspIRCd* Me) : Module::Module(Me) + ModuleChgIdent(InspIRCd* Me) : Module(Me) { mycommand = new cmd_chgident(ServerInstance); ServerInstance->AddCommand(mycommand); @@ -98,7 +98,7 @@ class ModuleChgIdentFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleChgIdentFactory; } diff --git a/src/modules/m_cloaking.cpp b/src/modules/m_cloaking.cpp index e53124aa0..1b6888426 100644 --- a/src/modules/m_cloaking.cpp +++ b/src/modules/m_cloaking.cpp @@ -271,7 +271,7 @@ class ModuleCloaking : public Module public: ModuleCloaking(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ServerInstance->UseInterface("HashRequest"); @@ -336,7 +336,7 @@ class ModuleCloakingFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleCloakingFactory; } diff --git a/src/modules/m_clones.cpp b/src/modules/m_clones.cpp index e51680a7f..afb0c3a4b 100644 --- a/src/modules/m_clones.cpp +++ b/src/modules/m_clones.cpp @@ -74,7 +74,7 @@ class ModuleClones : public Module private: cmd_clones *mycommand; public: - ModuleClones(InspIRCd* Me) : Module::Module(Me) + ModuleClones(InspIRCd* Me) : Module(Me) { mycommand = new cmd_clones(ServerInstance); @@ -117,7 +117,7 @@ class ModuleClonesFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleClonesFactory; } diff --git a/src/modules/m_conn_join.cpp b/src/modules/m_conn_join.cpp index a2c45641c..b125a772b 100644 --- a/src/modules/m_conn_join.cpp +++ b/src/modules/m_conn_join.cpp @@ -46,7 +46,7 @@ class ModuleConnJoin : public Module public: ModuleConnJoin(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { OnRehash(NULL, ""); } @@ -104,7 +104,7 @@ class ModuleConnJoinFactory : public ModuleFactory } }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleConnJoinFactory; } diff --git a/src/modules/m_conn_umodes.cpp b/src/modules/m_conn_umodes.cpp index 2226f9776..1973820cd 100644 --- a/src/modules/m_conn_umodes.cpp +++ b/src/modules/m_conn_umodes.cpp @@ -29,7 +29,7 @@ class ModuleModesOnConnect : public Module public: ModuleModesOnConnect(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { Conf = new ConfigReader(ServerInstance); @@ -79,7 +79,7 @@ class ModuleModesOnConnect : public Module tokens.push_back(buf); int size = tokens.size() + 1; - const char* modes[size]; + const char** modes = new const char*[size]; modes[0] = user->nick; modes[1] = tokens[0].c_str(); @@ -95,6 +95,7 @@ class ModuleModesOnConnect : public Module } ServerInstance->Parser->CallHandler("MODE", modes, size, user); + delete [] modes; } break; } @@ -123,7 +124,7 @@ class ModuleModesOnConnectFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleModesOnConnectFactory; } diff --git a/src/modules/m_conn_waitpong.cpp b/src/modules/m_conn_waitpong.cpp index 1c2632125..9370b9931 100644 --- a/src/modules/m_conn_waitpong.cpp +++ b/src/modules/m_conn_waitpong.cpp @@ -29,7 +29,7 @@ class ModuleWaitPong : public Module public: ModuleWaitPong(InspIRCd* Me) - : Module::Module(Me), Instance(Me), extenstr("waitpong_pingstr") + : Module(Me), Instance(Me), extenstr("waitpong_pingstr") { OnRehash(NULL,""); } @@ -166,7 +166,7 @@ class ModuleWaitPongFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleWaitPongFactory; } diff --git a/src/modules/m_connflood.cpp b/src/modules/m_connflood.cpp index c834605b0..1cfacf480 100644 --- a/src/modules/m_connflood.cpp +++ b/src/modules/m_connflood.cpp @@ -31,7 +31,7 @@ private: public: - ModuleConnFlood(InspIRCd* Me) : Module::Module(Me) + ModuleConnFlood(InspIRCd* Me) : Module(Me) { InitConf(); @@ -137,7 +137,7 @@ public: }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleConnFloodFactory; } diff --git a/src/modules/m_dccallow.cpp b/src/modules/m_dccallow.cpp index 23d259f6c..367a3769e 100644 --- a/src/modules/m_dccallow.cpp +++ b/src/modules/m_dccallow.cpp @@ -254,7 +254,7 @@ class ModuleDCCAllow : public Module public: ModuleDCCAllow(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { Conf = new ConfigReader(ServerInstance); mycommand = new cmd_dccallow(ServerInstance); @@ -507,7 +507,7 @@ class ModuleDCCAllowFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleDCCAllowFactory; } diff --git a/src/modules/m_deaf.cpp b/src/modules/m_deaf.cpp index 0be919e65..109916881 100644 --- a/src/modules/m_deaf.cpp +++ b/src/modules/m_deaf.cpp @@ -53,7 +53,7 @@ class ModuleDeaf : public Module User_d* m1; public: ModuleDeaf(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { m1 = new User_d(ServerInstance); if (!ServerInstance->AddMode(m1, 'd')) @@ -152,7 +152,7 @@ class ModuleDeafFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleDeafFactory; } diff --git a/src/modules/m_denychans.cpp b/src/modules/m_denychans.cpp index db42ab43a..d143bffbf 100644 --- a/src/modules/m_denychans.cpp +++ b/src/modules/m_denychans.cpp @@ -28,7 +28,7 @@ class ModuleDenyChannels : public Module ConfigReader *Conf; public: - ModuleDenyChannels(InspIRCd* Me) : Module::Module(Me) + ModuleDenyChannels(InspIRCd* Me) : Module(Me) { Conf = new ConfigReader(ServerInstance); @@ -98,7 +98,7 @@ class ModuleDenyChannelsFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleDenyChannelsFactory; } diff --git a/src/modules/m_devoice.cpp b/src/modules/m_devoice.cpp index 7400d2212..3c21a64f6 100644 --- a/src/modules/m_devoice.cpp +++ b/src/modules/m_devoice.cpp @@ -62,7 +62,7 @@ class ModuleDeVoice : public Module { cmd_devoice *mycommand; public: - ModuleDeVoice(InspIRCd* Me) : Module::Module(Me) + ModuleDeVoice(InspIRCd* Me) : Module(Me) { mycommand = new cmd_devoice(ServerInstance); @@ -99,7 +99,7 @@ class ModuleDeVoiceFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleDeVoiceFactory; } diff --git a/src/modules/m_dnsbl.cpp b/src/modules/m_dnsbl.cpp index 3c6260a72..d53706af3 100644 --- a/src/modules/m_dnsbl.cpp +++ b/src/modules/m_dnsbl.cpp @@ -11,11 +11,6 @@ * --------------------------------------------------- */ -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> -#include <arpa/inet.h> -#include <stdint.h> #include "inspircd.h" #include "xline.h" #include "dns.h" @@ -23,6 +18,14 @@ #include "channels.h" #include "modules.h" +#ifndef WINDOWS +#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +#include <arpa/inet.h> +#include <stdint.h> +#endif + /* $ModDesc: Provides handling of DNS blacklists */ /* Class holding data for a single entry */ @@ -167,7 +170,7 @@ class ModuleDNSBL : public Module return DNSBLConfEntry::I_UNKNOWN; } public: - ModuleDNSBL(InspIRCd *Me) : Module::Module(Me) + ModuleDNSBL(InspIRCd *Me) : Module(Me) { ReadConf(); } @@ -360,7 +363,7 @@ class ModuleDNSBLFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleDNSBLFactory; } diff --git a/src/modules/m_filter.cpp b/src/modules/m_filter.cpp index 133406ccb..b0c932ada 100644 --- a/src/modules/m_filter.cpp +++ b/src/modules/m_filter.cpp @@ -31,7 +31,7 @@ class ModuleFilter : public FilterBase public: ModuleFilter(InspIRCd* Me) - : FilterBase::FilterBase(Me, "m_filter.so") + : FilterBase(Me, "m_filter.so") { OnRehash(NULL,""); } @@ -155,7 +155,7 @@ class ModuleFilterFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleFilterFactory; } diff --git a/src/modules/m_filter.h b/src/modules/m_filter.h index 5797cc310..dbe8b4342 100644 --- a/src/modules/m_filter.h +++ b/src/modules/m_filter.h @@ -148,7 +148,7 @@ class cmd_filter : public command_t } }; -FilterBase::FilterBase(InspIRCd* Me, const std::string &source) : Module::Module(Me) +FilterBase::FilterBase(InspIRCd* Me, const std::string &source) : Module(Me) { filtcommand = new cmd_filter(this, Me, source); ServerInstance->AddCommand(filtcommand); diff --git a/src/modules/m_foobar.cpp b/src/modules/m_foobar.cpp index a42275127..cd0b15bd9 100644 --- a/src/modules/m_foobar.cpp +++ b/src/modules/m_foobar.cpp @@ -34,7 +34,7 @@ class ModuleFoobar : public Module public: ModuleFoobar(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { // The constructor just makes a copy of the server class @@ -124,7 +124,7 @@ class ModuleFoobarFactory : public ModuleFactory // class for this library // -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleFoobarFactory; } diff --git a/src/modules/m_globalload.cpp b/src/modules/m_globalload.cpp index ca945b496..7cc38eaa1 100644 --- a/src/modules/m_globalload.cpp +++ b/src/modules/m_globalload.cpp @@ -117,7 +117,7 @@ class ModuleGlobalLoad : public Module cmd_greloadmodule *mycommand3; public: - ModuleGlobalLoad(InspIRCd* Me) : Module::Module(Me) + ModuleGlobalLoad(InspIRCd* Me) : Module(Me) { mycommand = new cmd_gloadmodule(ServerInstance); @@ -158,7 +158,7 @@ class ModuleGlobalLoadFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleGlobalLoadFactory; } diff --git a/src/modules/m_globops.cpp b/src/modules/m_globops.cpp index 7e4d88d94..4dbe8dfb5 100644 --- a/src/modules/m_globops.cpp +++ b/src/modules/m_globops.cpp @@ -52,7 +52,7 @@ class ModuleGlobops : public Module cmd_globops* mycommand; public: ModuleGlobops(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_globops(ServerInstance); ServerInstance->AddCommand(mycommand); @@ -94,7 +94,7 @@ class ModuleGlobopsFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleGlobopsFactory; } diff --git a/src/modules/m_helpop.cpp b/src/modules/m_helpop.cpp index f82004f16..5a02f2bf0 100644 --- a/src/modules/m_helpop.cpp +++ b/src/modules/m_helpop.cpp @@ -116,7 +116,7 @@ class ModuleHelpop : public Module public: ModuleHelpop(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ReadConfig(); ho = new Helpop(ServerInstance); @@ -206,7 +206,7 @@ class ModuleHelpopFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleHelpopFactory; } diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp index a2bc4aa54..cf7c95c0f 100644 --- a/src/modules/m_hidechans.cpp +++ b/src/modules/m_hidechans.cpp @@ -58,7 +58,7 @@ class ModuleHideChans : public Module HideChans* hm; public: ModuleHideChans(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { hm = new HideChans(ServerInstance); @@ -110,7 +110,7 @@ class ModuleHideChansFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleHideChansFactory; } diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp index ce627f448..afc2e6cfa 100644 --- a/src/modules/m_hideoper.cpp +++ b/src/modules/m_hideoper.cpp @@ -57,7 +57,7 @@ class ModuleHideOper : public Module HideOper* hm; public: ModuleHideOper(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { hm = new HideOper(ServerInstance); @@ -109,7 +109,7 @@ class ModuleHideOperFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleHideOperFactory; } diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp index 473a35d12..d2e51a187 100644 --- a/src/modules/m_hostchange.cpp +++ b/src/modules/m_hostchange.cpp @@ -41,7 +41,7 @@ class ModuleHostChange : public Module public: ModuleHostChange(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { Conf = new ConfigReader(ServerInstance); OnRehash(NULL,""); @@ -160,7 +160,7 @@ class ModuleHostChangeFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleHostChangeFactory; } diff --git a/src/modules/m_http_client.cpp b/src/modules/m_http_client.cpp index e3c50ef82..2cb890a1e 100644 --- a/src/modules/m_http_client.cpp +++ b/src/modules/m_http_client.cpp @@ -75,7 +75,7 @@ class ModuleHTTPClient : public Module HTTPList sockets; ModuleHTTPClient(InspIRCd *Me) - : Module::Module(Me) + : Module(Me) { } @@ -360,7 +360,7 @@ class ModuleHTTPClientFactory : public ModuleFactory } }; -extern "C" void *init_module(void) +extern "C" DllExport void *init_module(void) { return new ModuleHTTPClientFactory; } diff --git a/src/modules/m_httpd.cpp b/src/modules/m_httpd.cpp index 3342ba37d..49c8d8803 100644 --- a/src/modules/m_httpd.cpp +++ b/src/modules/m_httpd.cpp @@ -378,7 +378,7 @@ class ModuleHttpServer : public Module } } - ModuleHttpServer(InspIRCd* Me) : Module::Module(Me) + ModuleHttpServer(InspIRCd* Me) : Module(Me) { ReadConfig(); } @@ -437,7 +437,7 @@ class ModuleHttpServerFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleHttpServerFactory; } diff --git a/src/modules/m_httpd_stats.cpp b/src/modules/m_httpd_stats.cpp index a72c94c47..e800b3d98 100644 --- a/src/modules/m_httpd_stats.cpp +++ b/src/modules/m_httpd_stats.cpp @@ -45,7 +45,7 @@ class ModuleHttpStats : public Module this->stylesheet = c.ReadValue("httpstats", "stylesheet", 0); } - ModuleHttpStats(InspIRCd* Me) : Module::Module(Me) + ModuleHttpStats(InspIRCd* Me) : Module(Me) { ReadConfig(); @@ -258,7 +258,7 @@ class ModuleHttpStatsFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleHttpStatsFactory; } diff --git a/src/modules/m_ident.cpp b/src/modules/m_ident.cpp index cf0f41383..00d12b8ec 100644 --- a/src/modules/m_ident.cpp +++ b/src/modules/m_ident.cpp @@ -205,7 +205,7 @@ class ModuleIdent : public Module } ModuleIdent(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ReadSettings(); @@ -349,7 +349,7 @@ class ModuleIdentFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleIdentFactory; } diff --git a/src/modules/m_invisible.cpp b/src/modules/m_invisible.cpp index 0f9578666..30a20f2ed 100644 --- a/src/modules/m_invisible.cpp +++ b/src/modules/m_invisible.cpp @@ -147,7 +147,7 @@ class ModuleInvisible : public Module InvisibleDeOper* ido; public: ModuleInvisible(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { conf = new ConfigReader(ServerInstance); qm = new InvisibleMode(ServerInstance); @@ -292,7 +292,7 @@ class ModuleInvisibleFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleInvisibleFactory; } diff --git a/src/modules/m_inviteexception.cpp b/src/modules/m_inviteexception.cpp index 8cca13b1e..88c2c507f 100644 --- a/src/modules/m_inviteexception.cpp +++ b/src/modules/m_inviteexception.cpp @@ -168,7 +168,7 @@ class ModuleInviteExceptionFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleInviteExceptionFactory; } diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp index 358f3e08c..f6b5f4b90 100644 --- a/src/modules/m_joinflood.cpp +++ b/src/modules/m_joinflood.cpp @@ -218,7 +218,7 @@ class ModuleJoinFlood : public Module public: ModuleJoinFlood(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { jf = new JoinFlood(ServerInstance); @@ -305,7 +305,7 @@ class ModuleJoinFloodFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleJoinFloodFactory; } diff --git a/src/modules/m_jumpserver.cpp b/src/modules/m_jumpserver.cpp index d48223ffb..f21fb8e3a 100644 --- a/src/modules/m_jumpserver.cpp +++ b/src/modules/m_jumpserver.cpp @@ -128,7 +128,7 @@ class ModuleJumpServer : public Module cmd_jumpserver* js; public: ModuleJumpServer(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { js = new cmd_jumpserver(ServerInstance); @@ -181,7 +181,7 @@ class ModuleJumpServerFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleJumpServerFactory; } diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index 87e8646ec..a38d260bb 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -129,7 +129,7 @@ class ModuleKickNoRejoin : public Module public: ModuleKickNoRejoin(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { kr = new KickRejoin(ServerInstance); @@ -245,7 +245,7 @@ class ModuleKickNoRejoinFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleKickNoRejoinFactory; } diff --git a/src/modules/m_knock.cpp b/src/modules/m_knock.cpp index 70480e188..a725844b7 100644 --- a/src/modules/m_knock.cpp +++ b/src/modules/m_knock.cpp @@ -103,7 +103,7 @@ class ModuleKnock : public Module cmd_knock* mycommand; Knock* kn; public: - ModuleKnock(InspIRCd* Me) : Module::Module(Me) + ModuleKnock(InspIRCd* Me) : Module(Me) { kn = new Knock(ServerInstance); @@ -150,7 +150,7 @@ class ModuleKnockFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleKnockFactory; } diff --git a/src/modules/m_lockserv.cpp b/src/modules/m_lockserv.cpp index f3ac93347..8a8471aa5 100644 --- a/src/modules/m_lockserv.cpp +++ b/src/modules/m_lockserv.cpp @@ -84,7 +84,7 @@ private: } public: - ModuleLockserv(InspIRCd* Me) : Module::Module(Me) + ModuleLockserv(InspIRCd* Me) : Module(Me) { ResetLocked(); lockcommand = new cmd_lockserv(ServerInstance, locked); @@ -146,7 +146,7 @@ public: } }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleLockservFactory; } diff --git a/src/modules/m_md5.cpp b/src/modules/m_md5.cpp index d43204b99..19b351e0c 100644 --- a/src/modules/m_md5.cpp +++ b/src/modules/m_md5.cpp @@ -270,7 +270,7 @@ class ModuleMD5 : public Module public: ModuleMD5(InspIRCd* Me) - : Module::Module(Me), key(NULL), chars(NULL) + : Module(Me), key(NULL), chars(NULL) { ServerInstance->PublishInterface("HashRequest", this); } @@ -341,7 +341,7 @@ class ModuleMD5Factory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleMD5Factory; } diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 6f3beb512..ae458a0d6 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -196,7 +196,7 @@ class ModuleMsgFlood : public Module public: ModuleMsgFlood(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mf = new MsgFlood(ServerInstance); @@ -309,7 +309,7 @@ class ModuleMsgFloodFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleMsgFloodFactory; } diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp index db8270cb9..f078aa8bf 100644 --- a/src/modules/m_namesx.cpp +++ b/src/modules/m_namesx.cpp @@ -25,7 +25,7 @@ class ModuleNamesX : public Module public: ModuleNamesX(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { } @@ -143,7 +143,7 @@ class ModuleNamesXFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleNamesXFactory; } diff --git a/src/modules/m_nicklock.cpp b/src/modules/m_nicklock.cpp index dd51be1cc..f80bff5b1 100644 --- a/src/modules/m_nicklock.cpp +++ b/src/modules/m_nicklock.cpp @@ -112,7 +112,7 @@ class ModuleNickLock : public Module char* n; public: ModuleNickLock(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { cmd1 = new cmd_nicklock(ServerInstance); @@ -181,7 +181,7 @@ class ModuleNickLockFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleNickLockFactory; } diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp index 029a95065..7ac9e0824 100644 --- a/src/modules/m_noctcp.cpp +++ b/src/modules/m_noctcp.cpp @@ -56,7 +56,7 @@ class ModuleNoCTCP : public Module public: ModuleNoCTCP(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { nc = new NoCTCP(ServerInstance); @@ -126,7 +126,7 @@ class ModuleNoCTCPFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleNoCTCPFactory; } diff --git a/src/modules/m_noinvite.cpp b/src/modules/m_noinvite.cpp index 0b4e1723b..db3ae400f 100644 --- a/src/modules/m_noinvite.cpp +++ b/src/modules/m_noinvite.cpp @@ -51,7 +51,7 @@ class ModuleNoInvite : public Module NoInvite *ni; public: - ModuleNoInvite(InspIRCd* Me) : Module::Module(Me) + ModuleNoInvite(InspIRCd* Me) : Module(Me) { ni = new NoInvite(ServerInstance); if (!ServerInstance->AddMode(ni, 'V')) @@ -104,7 +104,7 @@ class ModuleNoInviteFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleNoInviteFactory; } diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp index c5ad179e8..975d86e3b 100644 --- a/src/modules/m_nokicks.cpp +++ b/src/modules/m_nokicks.cpp @@ -57,7 +57,7 @@ class ModuleNoKicks : public Module public: ModuleNoKicks(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { nk = new NoKicks(ServerInstance); @@ -124,7 +124,7 @@ class ModuleNoKicksFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleNoKicksFactory; } diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp index 103d07c2a..1ac82ed29 100644 --- a/src/modules/m_nonicks.cpp +++ b/src/modules/m_nonicks.cpp @@ -53,7 +53,7 @@ class ModuleNoNickChange : public Module NoNicks* nn; public: ModuleNoNickChange(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { nn = new NoNicks(ServerInstance); @@ -120,7 +120,7 @@ class ModuleNoNickChangeFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleNoNickChangeFactory; } diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp index 31d423996..528eeb0f4 100644 --- a/src/modules/m_nonotice.cpp +++ b/src/modules/m_nonotice.cpp @@ -53,7 +53,7 @@ class ModuleNoNotice : public Module public: ModuleNoNotice(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { nt = new NoNotice(ServerInstance); @@ -120,7 +120,7 @@ class ModuleNoNoticeFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleNoNoticeFactory; } diff --git a/src/modules/m_oper_hash.cpp b/src/modules/m_oper_hash.cpp index 8c9ca0556..80869898c 100644 --- a/src/modules/m_oper_hash.cpp +++ b/src/modules/m_oper_hash.cpp @@ -79,7 +79,7 @@ class ModuleOperHash : public Module public: ModuleOperHash(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { /* Read the config file first */ @@ -182,7 +182,7 @@ class ModuleOperHashFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleOperHashFactory; } diff --git a/src/modules/m_operchans.cpp b/src/modules/m_operchans.cpp index 6b89332be..15ef0faf9 100644 --- a/src/modules/m_operchans.cpp +++ b/src/modules/m_operchans.cpp @@ -53,7 +53,7 @@ class ModuleOperChans : public Module OperChans* oc; public: ModuleOperChans(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { oc = new OperChans(ServerInstance); @@ -114,7 +114,7 @@ class ModuleOperChansFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleOperChansFactory; } diff --git a/src/modules/m_operjoin.cpp b/src/modules/m_operjoin.cpp index c733bd3a1..12c17745a 100644 --- a/src/modules/m_operjoin.cpp +++ b/src/modules/m_operjoin.cpp @@ -44,7 +44,7 @@ class ModuleOperjoin : public Module } public: - ModuleOperjoin(InspIRCd* Me) : Module::Module(Me) + ModuleOperjoin(InspIRCd* Me) : Module(Me) { OnRehash(NULL, ""); } @@ -104,7 +104,7 @@ class ModuleOperjoinFactory : public ModuleFactory } }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleOperjoinFactory; } diff --git a/src/modules/m_operlevels.cpp b/src/modules/m_operlevels.cpp index 1291b28de..8832596f6 100644 --- a/src/modules/m_operlevels.cpp +++ b/src/modules/m_operlevels.cpp @@ -33,7 +33,7 @@ class ModuleOperLevels : public Module public: ModuleOperLevels(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { @@ -117,7 +117,7 @@ class ModuleOperLevelsFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleOperLevelsFactory; } diff --git a/src/modules/m_operlog.cpp b/src/modules/m_operlog.cpp index 195415340..ce6e7aea4 100644 --- a/src/modules/m_operlog.cpp +++ b/src/modules/m_operlog.cpp @@ -24,7 +24,7 @@ class ModuleOperLog : public Module private: public: - ModuleOperLog(InspIRCd* Me) : Module::Module(Me) + ModuleOperLog(InspIRCd* Me) : Module(Me) { } @@ -94,7 +94,7 @@ class ModuleOperLogFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleOperLogFactory; } diff --git a/src/modules/m_opermodes.cpp b/src/modules/m_opermodes.cpp index 43c271c3d..30f6fef9c 100644 --- a/src/modules/m_opermodes.cpp +++ b/src/modules/m_opermodes.cpp @@ -29,7 +29,7 @@ class ModuleModesOnOper : public Module public: ModuleModesOnOper(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { Conf = new ConfigReader(ServerInstance); @@ -82,7 +82,7 @@ class ModuleModesOnOper : public Module tokens.push_back(buf); int size = tokens.size() + 1; - const char* modes[size]; + char** modes = new char*[size]; modes[0] = user->nick; modes[1] = (char*)tokens[0].c_str(); @@ -103,7 +103,8 @@ class ModuleModesOnOper : public Module n.push_back(modes[j]); } rmode.Send(ServerInstance); - ServerInstance->SendMode(modes, size, user); + ServerInstance->SendMode((const char**)modes, size, user); + delete [] modes; } break; } @@ -132,7 +133,7 @@ class ModuleModesOnOperFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleModesOnOperFactory; } diff --git a/src/modules/m_opermotd.cpp b/src/modules/m_opermotd.cpp index 447468caf..f08b287bd 100644 --- a/src/modules/m_opermotd.cpp +++ b/src/modules/m_opermotd.cpp @@ -81,7 +81,7 @@ class ModuleOpermotd : public Module } ModuleOpermotd(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { opermotd = NULL; mycommand = new cmd_opermotd(ServerInstance); @@ -132,7 +132,7 @@ class ModuleOpermotdFactory : public ModuleFactory } }; -extern "C" void* init_module(void) +extern "C" DllExport void* init_module(void) { return new ModuleOpermotdFactory; } diff --git a/src/modules/m_override.cpp b/src/modules/m_override.cpp index 31b52e853..e7f424194 100644 --- a/src/modules/m_override.cpp +++ b/src/modules/m_override.cpp @@ -33,7 +33,7 @@ class ModuleOverride : public Module public: ModuleOverride(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { // read our config options (main config file) OnRehash(NULL,""); @@ -311,7 +311,7 @@ class ModuleOverrideFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleOverrideFactory; } diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 2eb5539b8..701e5da91 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -81,7 +81,7 @@ class ModuleRandQuote : public Module ConfigReader *conf; public: ModuleRandQuote(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { conf = new ConfigReader(ServerInstance); @@ -157,7 +157,7 @@ class ModuleRandQuoteFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleRandQuoteFactory; } diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp index e09c9b33b..492d39e58 100644 --- a/src/modules/m_redirect.cpp +++ b/src/modules/m_redirect.cpp @@ -104,7 +104,7 @@ class ModuleRedirect : public Module public: ModuleRedirect(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { re = new Redirect(ServerInstance); @@ -177,7 +177,7 @@ class ModuleRedirectFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleRedirectFactory; } diff --git a/src/modules/m_regonlycreate.cpp b/src/modules/m_regonlycreate.cpp index 9874936d8..f4738ef08 100644 --- a/src/modules/m_regonlycreate.cpp +++ b/src/modules/m_regonlycreate.cpp @@ -22,7 +22,7 @@ class ModuleRegOnlyCreate : public Module { public: ModuleRegOnlyCreate(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { } @@ -78,7 +78,7 @@ class ModuleRegOnlyCreateFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleRegOnlyCreateFactory; } diff --git a/src/modules/m_remove.cpp b/src/modules/m_remove.cpp index e5c433b84..56a54fc37 100644 --- a/src/modules/m_remove.cpp +++ b/src/modules/m_remove.cpp @@ -249,7 +249,7 @@ class ModuleRemove : public Module public: ModuleRemove(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_remove(ServerInstance, supportnokicks); mycommand2 = new cmd_fpart(ServerInstance, supportnokicks); @@ -308,7 +308,7 @@ class ModuleRemoveFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleRemoveFactory; } diff --git a/src/modules/m_restrictbanned.cpp b/src/modules/m_restrictbanned.cpp index b891d5659..6f0e991e5 100644 --- a/src/modules/m_restrictbanned.cpp +++ b/src/modules/m_restrictbanned.cpp @@ -23,7 +23,7 @@ class ModuleRestrictBanned : public Module { private: public: - ModuleRestrictBanned(InspIRCd* Me) : Module::Module(Me) + ModuleRestrictBanned(InspIRCd* Me) : Module(Me) { } @@ -116,7 +116,7 @@ class ModuleRestrictBannedFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleRestrictBannedFactory; } diff --git a/src/modules/m_restrictchans.cpp b/src/modules/m_restrictchans.cpp index 68fb73577..eab419c46 100644 --- a/src/modules/m_restrictchans.cpp +++ b/src/modules/m_restrictchans.cpp @@ -43,7 +43,7 @@ class ModuleRestrictChans : public Module public: ModuleRestrictChans(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ReadConfig(); @@ -105,7 +105,7 @@ class ModuleRestrictChansFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleRestrictChansFactory; } diff --git a/src/modules/m_restrictmsg.cpp b/src/modules/m_restrictmsg.cpp index ce62296ac..e04366b59 100644 --- a/src/modules/m_restrictmsg.cpp +++ b/src/modules/m_restrictmsg.cpp @@ -29,7 +29,7 @@ class ModuleRestrictMsg : public Module public: ModuleRestrictMsg(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { } @@ -96,7 +96,7 @@ class ModuleRestrictMsgFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleRestrictMsgFactory; } diff --git a/src/modules/m_safelist.cpp b/src/modules/m_safelist.cpp index 424d01256..2bcb77a91 100644 --- a/src/modules/m_safelist.cpp +++ b/src/modules/m_safelist.cpp @@ -43,7 +43,7 @@ class ModuleSafeList : public Module int global_listing; int LimitList; public: - ModuleSafeList(InspIRCd* Me) : Module::Module(Me) + ModuleSafeList(InspIRCd* Me) : Module(Me) { OnRehash(NULL, ""); } @@ -285,7 +285,7 @@ class ModuleSafeListFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSafeListFactory; } diff --git a/src/modules/m_sajoin.cpp b/src/modules/m_sajoin.cpp index b91b1a2f0..decce5aef 100644 --- a/src/modules/m_sajoin.cpp +++ b/src/modules/m_sajoin.cpp @@ -96,7 +96,7 @@ class ModuleSajoin : public Module cmd_sajoin* mycommand; public: ModuleSajoin(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_sajoin(ServerInstance); @@ -135,7 +135,7 @@ class ModuleSajoinFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSajoinFactory; } diff --git a/src/modules/m_samode.cpp b/src/modules/m_samode.cpp index ddce91d51..89956a17d 100644 --- a/src/modules/m_samode.cpp +++ b/src/modules/m_samode.cpp @@ -79,7 +79,7 @@ class ModuleSaMode : public Module cmd_samode* mycommand; public: ModuleSaMode(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_samode(ServerInstance); @@ -116,7 +116,7 @@ class ModuleSaModeFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSaModeFactory; } diff --git a/src/modules/m_sanick.cpp b/src/modules/m_sanick.cpp index 43cb9e6da..34d9f9ab5 100644 --- a/src/modules/m_sanick.cpp +++ b/src/modules/m_sanick.cpp @@ -78,7 +78,7 @@ class ModuleSanick : public Module cmd_sanick* mycommand; public: ModuleSanick(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_sanick(ServerInstance); @@ -117,7 +117,7 @@ class ModuleSanickFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSanickFactory; } diff --git a/src/modules/m_sapart.cpp b/src/modules/m_sapart.cpp index 01df5c1be..680b4b4d4 100644 --- a/src/modules/m_sapart.cpp +++ b/src/modules/m_sapart.cpp @@ -93,7 +93,7 @@ class ModuleSapart : public Module cmd_sapart* mycommand; public: ModuleSapart(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_sapart(ServerInstance); @@ -132,7 +132,7 @@ class ModuleSapartFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSapartFactory; } diff --git a/src/modules/m_saquit.cpp b/src/modules/m_saquit.cpp index 5806f43bf..a7cacac5c 100644 --- a/src/modules/m_saquit.cpp +++ b/src/modules/m_saquit.cpp @@ -63,7 +63,7 @@ class ModuleSaquit : public Module cmd_saquit* mycommand; public: ModuleSaquit(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_saquit(ServerInstance); @@ -102,7 +102,7 @@ class ModuleSaquitFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSaquitFactory; } diff --git a/src/modules/m_securelist.cpp b/src/modules/m_securelist.cpp index 8be50dffe..319b58603 100644 --- a/src/modules/m_securelist.cpp +++ b/src/modules/m_securelist.cpp @@ -26,7 +26,7 @@ class ModuleSecureList : public Module std::vector<std::string> allowlist; time_t WaitTime; public: - ModuleSecureList(InspIRCd* Me) : Module::Module(Me) + ModuleSecureList(InspIRCd* Me) : Module(Me) { OnRehash(NULL,""); } @@ -118,7 +118,7 @@ class ModuleSecureListFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSecureListFactory; } diff --git a/src/modules/m_seenicks.cpp b/src/modules/m_seenicks.cpp index 2e632a5ba..959a62b31 100644 --- a/src/modules/m_seenicks.cpp +++ b/src/modules/m_seenicks.cpp @@ -24,7 +24,7 @@ class ModuleSeeNicks : public Module { public: ModuleSeeNicks(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { ServerInstance->SNO->EnableSnomask('n',"NICK"); ServerInstance->SNO->EnableSnomask('N',"REMOTENICK"); @@ -71,7 +71,7 @@ class ModuleSeeNicksFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSeeNicksFactory; } diff --git a/src/modules/m_services.cpp b/src/modules/m_services.cpp index 7e6e3121c..b8638d94a 100644 --- a/src/modules/m_services.cpp +++ b/src/modules/m_services.cpp @@ -173,7 +173,7 @@ class ModuleServices : public Module User_R* m5; public: ModuleServices(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { m1 = new Channel_r(ServerInstance); @@ -326,7 +326,7 @@ class ModuleServicesFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleServicesFactory; } diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 6defa1e2e..17c0b2bd9 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -116,7 +116,7 @@ class ModuleServicesAccount : public Module AChannel_M* m2; AUser_R* m3; public: - ModuleServicesAccount(InspIRCd* Me) : Module::Module(Me) + ModuleServicesAccount(InspIRCd* Me) : Module(Me) { m1 = new AChannel_R(ServerInstance); @@ -349,7 +349,7 @@ class ModuleServicesAccountFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleServicesAccountFactory; } diff --git a/src/modules/m_sethost.cpp b/src/modules/m_sethost.cpp index 6e984a62e..62b6bda83 100644 --- a/src/modules/m_sethost.cpp +++ b/src/modules/m_sethost.cpp @@ -67,7 +67,7 @@ class ModuleSetHost : public Module char hostmap[256]; public: ModuleSetHost(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { OnRehash(NULL,""); mycommand = new cmd_sethost(ServerInstance, hostmap); @@ -122,7 +122,7 @@ class ModuleSetHostFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSetHostFactory; } diff --git a/src/modules/m_setident.cpp b/src/modules/m_setident.cpp index a56aec0d1..f46c7112c 100644 --- a/src/modules/m_setident.cpp +++ b/src/modules/m_setident.cpp @@ -58,7 +58,7 @@ class ModuleSetIdent : public Module cmd_setident* mycommand; public: - ModuleSetIdent(InspIRCd* Me) : Module::Module(Me) + ModuleSetIdent(InspIRCd* Me) : Module(Me) { mycommand = new cmd_setident(ServerInstance); @@ -97,7 +97,7 @@ class ModuleSetIdentFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSetIdentFactory; } diff --git a/src/modules/m_setidle.cpp b/src/modules/m_setidle.cpp index 76a1ea3e5..6539bbdc8 100644 --- a/src/modules/m_setidle.cpp +++ b/src/modules/m_setidle.cpp @@ -55,7 +55,7 @@ class ModuleSetIdle : public Module cmd_setidle* mycommand; public: ModuleSetIdle(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_setidle(ServerInstance); @@ -93,7 +93,7 @@ class ModuleSetIdleFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSetIdleFactory; } diff --git a/src/modules/m_setname.cpp b/src/modules/m_setname.cpp index bb78d6a0f..8661d9f2c 100644 --- a/src/modules/m_setname.cpp +++ b/src/modules/m_setname.cpp @@ -52,7 +52,7 @@ class ModuleSetName : public Module cmd_setname* mycommand; public: ModuleSetName(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_setname(ServerInstance); @@ -91,7 +91,7 @@ class ModuleSetNameFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSetNameFactory; } diff --git a/src/modules/m_sha256.cpp b/src/modules/m_sha256.cpp index 6ba625a41..6e1ac0e56 100644 --- a/src/modules/m_sha256.cpp +++ b/src/modules/m_sha256.cpp @@ -139,7 +139,7 @@ uint32_t sha256_k[64] = class ModuleSHA256 : public Module { - void SHA256Init(struct SHA256Context *ctx, const unsigned int* key) + void SHA256Init(SHA256Context *ctx, const unsigned int* key) { if (key) { @@ -155,7 +155,7 @@ class ModuleSHA256 : public Module ctx->tot_len = 0; } - void SHA256Transform(struct SHA256Context *ctx, unsigned char *message, unsigned int block_nb) + void SHA256Transform(SHA256Context *ctx, unsigned char *message, unsigned int block_nb) { uint32_t w[64]; uint32_t wv[8]; @@ -189,7 +189,7 @@ class ModuleSHA256 : public Module } } - void SHA256Update(struct SHA256Context *ctx, unsigned char *message, unsigned int len) + void SHA256Update(SHA256Context *ctx, unsigned char *message, unsigned int len) { unsigned int rem_len = SHA256_BLOCK_SIZE - ctx->len; memcpy(&ctx->block[ctx->len], message, rem_len); @@ -209,7 +209,7 @@ class ModuleSHA256 : public Module ctx->tot_len += (block_nb + 1) << 6; } - void SHA256Final(struct SHA256Context *ctx, unsigned char *digest) + void SHA256Final(SHA256Context *ctx, unsigned char *digest) { unsigned int block_nb = (1 + ((SHA256_BLOCK_SIZE - 9) < (ctx->len % SHA256_BLOCK_SIZE))); unsigned int len_b = (ctx->tot_len + ctx->len) << 3; @@ -226,7 +226,7 @@ class ModuleSHA256 : public Module { // Generate the hash unsigned char bytehash[SHA256_DIGEST_SIZE]; - struct SHA256Context ctx; + SHA256Context ctx; SHA256Init(&ctx, key); SHA256Update(&ctx, (unsigned char *)src, (unsigned int)len); SHA256Final(&ctx, bytehash); @@ -244,7 +244,7 @@ class ModuleSHA256 : public Module public: - ModuleSHA256(InspIRCd* Me) : Module::Module(Me), key(NULL), chars(NULL) + ModuleSHA256(InspIRCd* Me) : Module(Me), key(NULL), chars(NULL) { ServerInstance->PublishInterface("HashRequest", this); } @@ -313,7 +313,7 @@ public: }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSHA256Factory; } diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp index 2b83243c1..70c9865e1 100644 --- a/src/modules/m_showwhois.cpp +++ b/src/modules/m_showwhois.cpp @@ -59,7 +59,7 @@ class ModuleShowwhois : public Module public: - ModuleShowwhois(InspIRCd* Me) : Module::Module(Me) + ModuleShowwhois(InspIRCd* Me) : Module(Me) { sw = new SeeWhois(ServerInstance); @@ -124,7 +124,7 @@ class ModuleShowwhoisFactory : public ModuleFactory }; -extern "C" void* init_module() +extern "C" DllExport void* init_module() { return new ModuleShowwhoisFactory; } diff --git a/src/modules/m_silence.cpp b/src/modules/m_silence.cpp index 42b7f96e9..773d28ece 100644 --- a/src/modules/m_silence.cpp +++ b/src/modules/m_silence.cpp @@ -136,7 +136,7 @@ class ModuleSilence : public Module public: ModuleSilence(InspIRCd* Me) - : Module::Module(Me), maxsilence(32) + : Module(Me), maxsilence(32) { OnRehash(NULL, ""); mycommand = new cmd_silence(ServerInstance, maxsilence); @@ -235,7 +235,7 @@ class ModuleSilenceFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSilenceFactory; } diff --git a/src/modules/m_silence_ext.cpp b/src/modules/m_silence_ext.cpp index e58e626c7..8b7ac9fbe 100644 --- a/src/modules/m_silence_ext.cpp +++ b/src/modules/m_silence_ext.cpp @@ -243,7 +243,7 @@ class ModuleSilence : public Module public: ModuleSilence(InspIRCd* Me) - : Module::Module(Me), maxsilence(32) + : Module(Me), maxsilence(32) { OnRehash(NULL, ""); mycommand = new cmd_silence(ServerInstance,maxsilence); @@ -393,7 +393,7 @@ class ModuleSilenceFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSilenceFactory; } diff --git a/src/modules/m_spanningtree/main.cpp b/src/modules/m_spanningtree/main.cpp index d037b7101..50de7da64 100644 --- a/src/modules/m_spanningtree/main.cpp +++ b/src/modules/m_spanningtree/main.cpp @@ -37,7 +37,7 @@ /* $ModDep: m_spanningtree/timesynctimer.h m_spanningtree/resolvers.h m_spanningtree/main.h m_spanningtree/utils.h m_spanningtree/treeserver.h m_spanningtree/link.h m_spanningtree/treesocket.h m_spanningtree/rconnect.h */ ModuleSpanningTree::ModuleSpanningTree(InspIRCd* Me) - : Module::Module(Me), max_local(0), max_global(0) + : Module(Me), max_local(0), max_global(0) { ServerInstance->UseInterface("InspSocketHook"); Utils = new SpanningTreeUtilities(Me, this); @@ -1379,7 +1379,7 @@ class ModuleSpanningTreeFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSpanningTreeFactory; } diff --git a/src/modules/m_spanningtree/treesocket1.cpp b/src/modules/m_spanningtree/treesocket1.cpp index b858061cb..27737c7ff 100644 --- a/src/modules/m_spanningtree/treesocket1.cpp +++ b/src/modules/m_spanningtree/treesocket1.cpp @@ -294,12 +294,18 @@ std::string TreeSocket::RandString(unsigned int length) { char* randombuf = new char[length+1]; std::string out; +#ifdef WINDOWS + int fd = -1; +#else int fd = open("/dev/urandom", O_RDONLY, 0); +#endif if (fd >= 0) { +#ifndef WINDOWS read(fd, randombuf, length); close(fd); +#endif } else { diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp index afba5b96a..da4dd5d4c 100644 --- a/src/modules/m_spanningtree/treesocket2.cpp +++ b/src/modules/m_spanningtree/treesocket2.cpp @@ -1496,19 +1496,13 @@ bool TreeSocket::ProcessLine(std::string &line) { strparams[q] = params[q].c_str(); } - switch (this->Instance->CallCommandHandler(command.c_str(), strparams, params.size(), who)) + if(!this->Instance->CallCommandHandler(command.c_str(), strparams, params.size(), who)) { - case CMD_INVALID: - this->SendError("Unrecognised command '"+std::string(command.c_str())+"' -- possibly loaded mismatched modules"); - return false; - break; - case CMD_FAILURE: - return true; - break; - default: - /* CMD_SUCCESS and CMD_USER_DELETED fall through here */ - break; + this->SendError("Unrecognised command '"+std::string(command.c_str())+"' -- possibly loaded mismatched modules"); + return false; } + else + return true; } else { diff --git a/src/modules/m_spanningtree/utils.h b/src/modules/m_spanningtree/utils.h index 1c94e264f..cb783a81a 100644 --- a/src/modules/m_spanningtree/utils.h +++ b/src/modules/m_spanningtree/utils.h @@ -29,7 +29,11 @@ class ModuleSpanningTree; /* This hash_map holds the hash equivalent of the server * tree, used for rapid linear lookups. */ +#ifdef WINDOWS +typedef nspace::hash_map<std::string, TreeServer*, nspace::hash_compare<string, less<string> > > server_hash; +#else typedef nspace::hash_map<std::string, TreeServer*, nspace::hash<string>, irc::StrHashComp> server_hash; +#endif typedef std::map<TreeServer*,TreeServer*> TreeServerList; diff --git a/src/modules/m_spy.cpp b/src/modules/m_spy.cpp index f0c361d82..356000f97 100644 --- a/src/modules/m_spy.cpp +++ b/src/modules/m_spy.cpp @@ -142,7 +142,7 @@ class ModuleSpy : public Module cmd_spylist *mycommand; cmd_spynames *mycommand2; public: - ModuleSpy(InspIRCd* Me) : Module::Module(Me) + ModuleSpy(InspIRCd* Me) : Module(Me) { mycommand = new cmd_spylist(ServerInstance); @@ -181,7 +181,7 @@ class ModuleSpyFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSpyFactory; } diff --git a/src/modules/m_ssl_dummy.cpp b/src/modules/m_ssl_dummy.cpp index 6f1ee4789..9995e7524 100644 --- a/src/modules/m_ssl_dummy.cpp +++ b/src/modules/m_ssl_dummy.cpp @@ -24,7 +24,7 @@ class ModuleSSLDummy : public Module char* dummy; public: - ModuleSSLDummy(InspIRCd* Me) : Module::Module(Me) + ModuleSSLDummy(InspIRCd* Me) : Module(Me) { } @@ -100,7 +100,7 @@ class ModuleSSLDummyFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSSLDummyFactory; } diff --git a/src/modules/m_sslmodes.cpp b/src/modules/m_sslmodes.cpp index 36f1e428a..92f623fe1 100644 --- a/src/modules/m_sslmodes.cpp +++ b/src/modules/m_sslmodes.cpp @@ -73,7 +73,7 @@ class ModuleSSLModes : public Module public: ModuleSSLModes(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { @@ -139,7 +139,7 @@ class ModuleSSLModesFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSSLModesFactory; } diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp index 76bc56ef5..e3ee3fe2f 100644 --- a/src/modules/m_stripcolor.cpp +++ b/src/modules/m_stripcolor.cpp @@ -90,7 +90,7 @@ class ModuleStripColor : public Module UserStripColor *usc; public: - ModuleStripColor(InspIRCd* Me) : Module::Module(Me) + ModuleStripColor(InspIRCd* Me) : Module(Me) { usc = new UserStripColor(ServerInstance); csc = new ChannelStripColor(ServerInstance); @@ -224,7 +224,7 @@ class ModuleStripColorFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleStripColorFactory; } diff --git a/src/modules/m_svshold.cpp b/src/modules/m_svshold.cpp index abef3d713..5e0f072f8 100644 --- a/src/modules/m_svshold.cpp +++ b/src/modules/m_svshold.cpp @@ -153,7 +153,7 @@ class ModuleSVSHold : public Module public: - ModuleSVSHold(InspIRCd* Me) : Module::Module(Me) + ModuleSVSHold(InspIRCd* Me) : Module(Me) { mycommand = new cmd_svshold(Me); ServerInstance->AddCommand(mycommand); @@ -290,7 +290,7 @@ class ModuleSVSHoldFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSVSHoldFactory; } diff --git a/src/modules/m_swhois.cpp b/src/modules/m_swhois.cpp index a79b1d10a..193191ab5 100644 --- a/src/modules/m_swhois.cpp +++ b/src/modules/m_swhois.cpp @@ -81,7 +81,7 @@ class ModuleSWhois : public Module ConfigReader* Conf; public: - ModuleSWhois(InspIRCd* Me) : Module::Module(Me) + ModuleSWhois(InspIRCd* Me) : Module(Me) { Conf = new ConfigReader(ServerInstance); @@ -275,7 +275,7 @@ class ModuleSWhoisFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleSWhoisFactory; } diff --git a/src/modules/m_taxonomy.cpp b/src/modules/m_taxonomy.cpp index c573e7761..9fb38d98e 100644 --- a/src/modules/m_taxonomy.cpp +++ b/src/modules/m_taxonomy.cpp @@ -62,7 +62,7 @@ class ModuleTaxonomy : public Module bool claimed; public: ModuleTaxonomy(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { // Create a new command @@ -116,7 +116,7 @@ class ModuleTaxonomyFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleTaxonomyFactory; } diff --git a/src/modules/m_testcommand.cpp b/src/modules/m_testcommand.cpp index 015c8b1df..e32e5f846 100644 --- a/src/modules/m_testcommand.cpp +++ b/src/modules/m_testcommand.cpp @@ -80,7 +80,7 @@ class ModuleTestCommand : public Module cmd_woot* newcommand; public: ModuleTestCommand(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { // Create a new command @@ -123,7 +123,7 @@ class ModuleTestCommandFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleTestCommandFactory; } diff --git a/src/modules/m_timedbans.cpp b/src/modules/m_timedbans.cpp index ec257d1e1..a1fb41439 100644 --- a/src/modules/m_timedbans.cpp +++ b/src/modules/m_timedbans.cpp @@ -115,7 +115,7 @@ class ModuleTimedBans : public Module cmd_tban* mycommand; public: ModuleTimedBans(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_tban(ServerInstance); @@ -224,7 +224,7 @@ class ModuleTimedBansFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleTimedBansFactory; } diff --git a/src/modules/m_tline.cpp b/src/modules/m_tline.cpp index 801218377..b5017ea2d 100644 --- a/src/modules/m_tline.cpp +++ b/src/modules/m_tline.cpp @@ -73,7 +73,7 @@ class ModuleTLine : public Module cmd_tline* newcommand; public: ModuleTLine(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { newcommand = new cmd_tline(ServerInstance); @@ -114,7 +114,7 @@ class ModuleTLineFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleTLineFactory; } diff --git a/src/modules/m_uhnames.cpp b/src/modules/m_uhnames.cpp index 3663ab4ca..a3caf7082 100644 --- a/src/modules/m_uhnames.cpp +++ b/src/modules/m_uhnames.cpp @@ -26,7 +26,7 @@ class ModuleUHNames : public Module public: ModuleUHNames(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { } @@ -113,7 +113,7 @@ class ModuleUHNamesFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleUHNamesFactory; } diff --git a/src/modules/m_uninvite.cpp b/src/modules/m_uninvite.cpp index a81952f10..babc4dc9f 100644 --- a/src/modules/m_uninvite.cpp +++ b/src/modules/m_uninvite.cpp @@ -87,7 +87,7 @@ class ModuleUninvite : public Module public: - ModuleUninvite(InspIRCd* Me) : Module::Module(Me) + ModuleUninvite(InspIRCd* Me) : Module(Me) { mycommand = new cmd_uninvite(ServerInstance); @@ -124,7 +124,7 @@ class ModuleUninviteFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleUninviteFactory; } diff --git a/src/modules/m_userip.cpp b/src/modules/m_userip.cpp index beab03e7e..b623c39ba 100644 --- a/src/modules/m_userip.cpp +++ b/src/modules/m_userip.cpp @@ -56,7 +56,7 @@ class ModuleUserIP : public Module cmd_userip* mycommand; public: ModuleUserIP(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { mycommand = new cmd_userip(ServerInstance); @@ -105,7 +105,7 @@ class ModuleUserIPFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleUserIPFactory; } diff --git a/src/modules/m_vhost.cpp b/src/modules/m_vhost.cpp index 0a08c7194..02926dbfa 100644 --- a/src/modules/m_vhost.cpp +++ b/src/modules/m_vhost.cpp @@ -61,7 +61,7 @@ class ModuleVHost : public Module cmd_vhost* mycommand; public: - ModuleVHost(InspIRCd* Me) : Module::Module(Me) + ModuleVHost(InspIRCd* Me) : Module(Me) { Conf = new ConfigReader(ServerInstance); @@ -113,7 +113,7 @@ class ModuleVHostFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleVHostFactory; } diff --git a/src/modules/m_watch.cpp b/src/modules/m_watch.cpp index b46d80b54..ef0f897d2 100644 --- a/src/modules/m_watch.cpp +++ b/src/modules/m_watch.cpp @@ -61,7 +61,11 @@ * of users using WATCH. */ +#ifdef WINDOWS +typedef nspace::hash_map<irc::string, std::deque<userrec*>, nspace::hash_compare<irc::string, less<irc::string> > > watchentries; +#else typedef nspace::hash_map<irc::string, std::deque<userrec*>, nspace::hash<irc::string> > watchentries; +#endif typedef std::map<irc::string, std::string> watchlist; /* Who's watching each nickname. @@ -301,7 +305,7 @@ class Modulewatch : public Module public: Modulewatch(InspIRCd* Me) - : Module::Module(Me), maxwatch(32) + : Module(Me), maxwatch(32) { OnRehash(NULL, ""); whos_watching_me = new watchentries(); @@ -480,7 +484,7 @@ class ModulewatchFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModulewatchFactory; } diff --git a/src/modules/m_xmlsocket.cpp b/src/modules/m_xmlsocket.cpp index 1cf9fafa2..3603f2fb5 100644 --- a/src/modules/m_xmlsocket.cpp +++ b/src/modules/m_xmlsocket.cpp @@ -29,7 +29,7 @@ class ModuleXMLSocket : public Module public: ModuleXMLSocket(InspIRCd* Me) - : Module::Module(Me) + : Module(Me) { OnRehash(NULL,""); } @@ -146,7 +146,7 @@ class ModuleXMLSocket : public Module return -1; /* We want to alter the buffer, so we have to make a copy */ - char tmpbuffer[count+1]; + char * tmpbuffer = new char[count + 1]; memcpy(tmpbuffer, buffer, count); /* XXX: This will actually generate lines "looking\0\0like\0\0this" @@ -160,6 +160,7 @@ class ModuleXMLSocket : public Module tmpbuffer[n] = 0; user->AddWriteBuf(std::string(tmpbuffer,count)); + delete [] tmpbuffer; return 1; } @@ -184,7 +185,7 @@ class ModuleXMLSocketFactory : public ModuleFactory }; -extern "C" void * init_module( void ) +extern "C" DllExport void * init_module( void ) { return new ModuleXMLSocketFactory; } |