]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_watch.cpp
Make VF_OPTCOMMON module mismatches a fatal link error by default
[user/henk/code/inspircd.git] / src / modules / m_watch.cpp
index eda1b74a397d7080a9c8af5d235f54d92fa06b87..9b98ca83badedc4b958e6ab5f3301e89b55b1b08 100644 (file)
  * Before you start screaming, this definition is only used here, so moving it to a header is pointless.
  * Yes, it's horrid. Blame cl for being different. -- w00t
  */
-#ifdef WINDOWS
-typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash_compare<irc::string, std::less<irc::string> > > watchentries;
+#if defined(WINDOWS) && !defined(HASHMAP_DEPRECATED)
+       typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash_compare<irc::string, std::less<irc::string> > > watchentries;
 #else
-typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash<irc::string> > watchentries;
+       typedef nspace::hash_map<irc::string, std::deque<User*>, nspace::hash<irc::string> > watchentries;
 #endif
 typedef std::map<irc::string, std::string> watchlist;
 
@@ -367,20 +367,18 @@ class CommandWatch : public Command
 
 class Modulewatch : public Module
 {
-       CommandWatch* mycommand;
-       CommandSVSWatch *sw;
        unsigned int maxwatch;
+       CommandWatch cmdw;
+       CommandSVSWatch sw;
 
  public:
        Modulewatch(InspIRCd* Me)
-               : Module(Me), maxwatch(32)
+               : Module(Me), maxwatch(32), cmdw(Me, maxwatch), sw(Me)
        {
                OnRehash(NULL);
                whos_watching_me = new watchentries();
-               mycommand = new CommandWatch(ServerInstance, maxwatch);
-               ServerInstance->AddCommand(mycommand);
-               sw = new CommandSVSWatch(ServerInstance);
-               ServerInstance->AddCommand(sw);
+               ServerInstance->AddCommand(&cmdw);
+               ServerInstance->AddCommand(&sw);
                Implementation eventlist[] = { I_OnRehash, I_OnGarbageCollect, I_OnCleanup, I_OnUserQuit, I_OnPostConnect, I_OnUserPostNick, I_On005Numeric, I_OnSetAway };
                ServerInstance->Modules->Attach(eventlist, this, 8);
        }