summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/account.h2
-rw-r--r--include/commands.h8
-rw-r--r--include/hashcomp.h6
-rw-r--r--include/modules.h6
-rw-r--r--include/services.h4
-rw-r--r--src/command.cpp2
-rw-r--r--src/config.c4
-rw-r--r--src/core/bs_badwords.c2
-rw-r--r--src/core/ns_recover.c2
-rw-r--r--src/core/ns_release.c2
-rw-r--r--src/hashcomp.cpp1
-rw-r--r--src/init.c2
-rw-r--r--src/main.c6
-rw-r--r--src/users.c8
-rw-r--r--src/windows.cpp10
15 files changed, 37 insertions, 28 deletions
diff --git a/include/account.h b/include/account.h
index 6c49bbd58..84a8c5b70 100644
--- a/include/account.h
+++ b/include/account.h
@@ -47,7 +47,7 @@ class NickAlias
NickCore *nc; /* I'm an alias of this */
};
-class NickCore : public Extensible
+class CoreExport NickCore : public Extensible
{
public:
NickCore();
diff --git a/include/commands.h b/include/commands.h
index 0fc5b59c6..408374cd2 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -6,9 +6,9 @@
* Please read COPYING and README for furhter details.
*
* Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- *
- * $Id$
+ * Based on the original code of Services by Andy Church.
+ *
+ * $Id$
*
*/
@@ -23,6 +23,6 @@
extern MDE Command *lookup_cmd(Command *list, char *name);
extern MDE void mod_help_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
extern MDE void mod_run_cmd(char *service, User *u, CommandHash *cmdTable[],const char *cmd);
-extern MDE void do_help_limited(char *service, User * u, Command * c);
+//extern MDE void do_help_limited(char *service, User * u, Command * c);
/*************************************************************************/
diff --git a/include/hashcomp.h b/include/hashcomp.h
index 9f095c2bb..32c46f009 100644
--- a/include/hashcomp.h
+++ b/include/hashcomp.h
@@ -21,7 +21,7 @@
* the next token, until none remain, at which point the method returns
* an empty string.
*/
-class sepstream
+class CoreExport sepstream
{
private:
/** Original string.
@@ -61,7 +61,7 @@ class sepstream
/** A derived form of sepstream, which seperates on commas
*/
-class commasepstream : public sepstream
+class CoreExport commasepstream : public sepstream
{
public:
/** Initialize with comma seperator
@@ -71,7 +71,7 @@ class commasepstream : public sepstream
/** A derived form of sepstream, which seperates on spaces
*/
-class spacesepstream : public sepstream
+class CoreExport spacesepstream : public sepstream
{
public:
/** Initialize with space seperator
diff --git a/include/modules.h b/include/modules.h
index cdd76301b..dbf6636e7 100644
--- a/include/modules.h
+++ b/include/modules.h
@@ -23,7 +23,7 @@
typedef HMODULE ano_module_t;
#define dlopen(file, unused) LoadLibrary(file)
- MDE const char *dlerror();
+ E const char *dlerror();
#define dlsym(file, symbol) (HMODULE)GetProcAddress(file, symbol)
#define dlclose(file) FreeLibrary(file) ? 0 : 1
#define ano_modclearerr() SetLastError(0)
@@ -219,7 +219,7 @@ enum CommandFlags
/** Every services command is a class, inheriting from Command.
*/
-class Command
+class CoreExport Command
{
int flags;
public:
@@ -509,7 +509,7 @@ class CoreExport ModuleManager
* This needs to be public to be used by FOREACH_MOD and friends.
*/
static std::vector<Module *> EventHandlers[I_END];
-
+
/** Load up a list of modules.
* @param total_modules The number of modules to load
* @param module_list The list of modules to load
diff --git a/include/services.h b/include/services.h
index 6c00c959f..17a24dfb6 100644
--- a/include/services.h
+++ b/include/services.h
@@ -1246,7 +1246,7 @@ class ServerConfig;
#include "extern.h"
#include "configreader.h"
-class IRCDProto
+class CoreExport IRCDProto
{
private:
virtual void SendSVSKillInternal(const char *, const char *, const char *) = 0;
@@ -1338,7 +1338,7 @@ class IRCDProto
virtual void SendAccountLogout(User *u, NickCore *account) { }
};
-class IRCDTS6Proto : public IRCDProto
+class CoreExport IRCDTS6Proto : public IRCDProto
{
};
diff --git a/src/command.cpp b/src/command.cpp
index 11a945136..5c754cd8d 100644
--- a/src/command.cpp
+++ b/src/command.cpp
@@ -70,4 +70,4 @@ void Command::UnsetFlag(CommandFlags flag)
bool Command::HasFlag(CommandFlags flag) const
{
return this->flags & flag;
-} \ No newline at end of file
+}
diff --git a/src/config.c b/src/config.c
index 0a230533e..60847e116 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1159,7 +1159,11 @@ int ServerConfig::Read(bool bail)
if (ConfValue(config_data, static_cast<std::string>(MultiValues[Index].tag),
static_cast<std::string>(MultiValues[Index].items[valuenum]),
static_cast<std::string>(MultiValues[Index].items_default[valuenum]), tagnum, item, allow_newlines)) {
+#ifdef _WIN32
+ long time = static_cast<long>(dotime(item.c_str()));
+#else
time_t time = dotime(item.c_str());
+#endif
vl.push_back(ValueItem(time));
}
else vl.push_back(ValueItem(0));
diff --git a/src/core/bs_badwords.c b/src/core/bs_badwords.c
index ad1bb7e49..5c6c77199 100644
--- a/src/core/bs_badwords.c
+++ b/src/core/bs_badwords.c
@@ -68,7 +68,7 @@ class CommandBSBadwords : public Command
return MOD_CONT;
}
- pos = strrchr(word, ' ');
+ pos = strrchr(const_cast<char *>(word), ' '); // XXX - Potentially unsafe cast
if (pos)
{
opt = pos + 1;
diff --git a/src/core/ns_recover.c b/src/core/ns_recover.c
index b4e3b9d44..98e4a9512 100644
--- a/src/core/ns_recover.c
+++ b/src/core/ns_recover.c
@@ -89,7 +89,7 @@ class CommandNSRecover : public Command
duration(u->nc, relstr, sizeof(relstr), NSReleaseTimeout);
notice_help(s_NickServ, u, NICK_HELP_RECOVER, relstr);
- do_help_limited(s_NickServ, u, this);
+ //do_help_limited(s_NickServ, u, this);
return MOD_CONT;
}
diff --git a/src/core/ns_release.c b/src/core/ns_release.c
index 3767fbbb8..d2ce4c57e 100644
--- a/src/core/ns_release.c
+++ b/src/core/ns_release.c
@@ -77,7 +77,7 @@ class CommandNSRelease : public Command
duration(u->nc, relstr, sizeof(relstr), NSReleaseTimeout);
notice_help(s_NickServ, u, NICK_HELP_RELEASE, relstr);
- do_help_limited(s_NickServ, u, this);
+ //do_help_limited(s_NickServ, u, this);
return true;
}
diff --git a/src/hashcomp.cpp b/src/hashcomp.cpp
index 4ec68832a..fe892c0e1 100644
--- a/src/hashcomp.cpp
+++ b/src/hashcomp.cpp
@@ -11,6 +11,7 @@
*
*/
+#include "services.h"
#include "hashcomp.h"
sepstream::sepstream(const std::string &source, char seperator) : tokens(source), sep(seperator)
diff --git a/src/init.c b/src/init.c
index 79633d0ec..e80f52c59 100644
--- a/src/init.c
+++ b/src/init.c
@@ -477,7 +477,9 @@ int init_secondary(int ac, char **av)
/* Set signal handlers. Catch certain signals to let us do things or
* panic as necessary, and ignore all others.
*/
+#ifndef _WIN32
signal(SIGHUP, sighandler);
+#endif
signal(SIGTERM, sighandler);
signal(SIGINT, sighandler);
diff --git a/src/main.c b/src/main.c
index 3968c4014..6515bd7a0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -33,8 +33,10 @@
#include "modules.h"
// getrlimit.
-#include <sys/time.h>
-#include <sys/resource.h>
+#ifndef _WIN32
+# include <sys/time.h>
+# include <sys/resource.h>
+#endif
/******** Global variables! ********/
diff --git a/src/users.c b/src/users.c
index 4be186909..94d8d35ed 100644
--- a/src/users.c
+++ b/src/users.c
@@ -149,7 +149,7 @@ void User::SetVIdent(const std::string &sident)
update_host(this);
}
-const std::string &User::GetVIdent() const
+const std::string &User::GetVIdent() const
{
if (ircd->vhostmode && (this->mode & ircd->vhostmode))
return this->vident;
@@ -597,7 +597,7 @@ User *do_nick(const char *source, const char *nick, const char *username, const
"DEFCON AKILL");
check_akill(nick, username, host, vhost, ipbuf);
}
-
+
/* As with akill checks earlier, we can't not add the user record, as the user may be exempt from bans.
* Instead, we'll just wait for the IRCd to tell us they are gone.
*/
@@ -1005,7 +1005,7 @@ char *create_mask(User * u)
// XXX: someone needs to rewrite this godawful kitten murdering pile of crap.
if (strspn(mhost.c_str(), "0123456789.") == mhost.length()
- && (s = strchr(mhost.c_str(), '.'))
+ && (s = strchr(const_cast<char *>(mhost.c_str()), '.')) // XXX - Potentially unsafe cast
&& (s = strchr(s + 1, '.'))
&& (s = strchr(s + 1, '.'))
&& (!strchr(s + 1, '.')))
@@ -1018,7 +1018,7 @@ char *create_mask(User * u)
}
else
{
- if ((s = strchr(mhost.c_str(), '.')) && strchr(s + 1, '.')) {
+ if ((s = strchr(const_cast<char *>(mhost.c_str()), '.')) && strchr(s + 1, '.')) {
s = sstrdup(strchr(mhost.c_str(), '.') - 1);
*s = '*';
strcpy(end, s);
diff --git a/src/windows.cpp b/src/windows.cpp
index 29a2131d1..988256838 100644
--- a/src/windows.cpp
+++ b/src/windows.cpp
@@ -10,18 +10,18 @@
*
* $Id$
*
- */
+ */
#ifdef WIN32
+#include <windows.h>
+
const char *dlerror()
{
static char errbuf[513];
DWORD err = GetLastError();
- if (err == 0)
+ if (!err)
return NULL;
- FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, errbuf, 512,
- NULL);
+ FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, errbuf, 512, NULL);
return errbuf;
}
#endif