summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/base.cpp3
-rw-r--r--src/dns.cpp6
-rw-r--r--src/main.cpp8
-rw-r--r--src/misc.cpp2
-rw-r--r--src/modules.cpp7
5 files changed, 18 insertions, 8 deletions
diff --git a/src/base.cpp b/src/base.cpp
index 0aec072a1..6977f81c5 100644
--- a/src/base.cpp
+++ b/src/base.cpp
@@ -1,5 +1,4 @@
-#include "services.h"
-#include "modules.h"
+#include "anope.h"
Base::Base()
{
diff --git a/src/dns.cpp b/src/dns.cpp
index c4cfbda51..ffd34e669 100644
--- a/src/dns.cpp
+++ b/src/dns.cpp
@@ -4,7 +4,7 @@ DNSManager *DNSEngine = NULL;
static inline unsigned short GetRandomID()
{
- return random();
+ return rand();
}
DNSRequest::DNSRequest(const Anope::string &addr, QueryType qt, bool cache, Module *c) : creator(c), address(addr), QT(qt)
@@ -226,7 +226,7 @@ DNSSocket::~DNSSocket()
int DNSSocket::SendTo(const unsigned char *buf, size_t len) const
{
- return sendto(this->GetFD(), buf, len, 0, &this->conaddr.sa, this->conaddr.size());
+ return sendto(this->GetFD(), reinterpret_cast<const char *>(buf), len, 0, &this->conaddr.sa, this->conaddr.size());
}
int DNSSocket::RecvFrom(char *buf, size_t len, sockaddrs &addrs) const
@@ -443,7 +443,7 @@ bool DNSSocket::ProcessRead()
}
default:
delete rr;
- request->OnError(DNS_ERROR_INVALID_TYPE, "Invalid query type");
+ request->OnError(DNS_ERROR_INVALIDTYPE, "Invalid query type");
rr = NULL;
}
diff --git a/src/main.cpp b/src/main.cpp
index fb3b59d1e..2cacfd8f2 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -242,7 +242,11 @@ static void services_shutdown()
void sighandler(int signum)
{
if (quitmsg.empty())
+#ifndef _WIN32
quitmsg = Anope::string("Services terminating via signal ") + strsignal(signum) + " (" + stringify(signum) + ")";
+#else
+ quitmsg = Anope::string("Services terminating via signal ") + stringify(signum);
+#endif
bool fatal = false;
if (started)
@@ -276,7 +280,11 @@ void sighandler(int signum)
signal(SIGHUP, SIG_IGN);
#endif
+#ifndef _WIN32
Log() << "Received " << strsignal(signum) << " signal (" << signum << "), exiting.";
+#else
+ Log() << "Received signal " << signum << ", exiting.";
+#endif
if (Config->GlobalOnCycle)
oper_global("", "%s", Config->GlobalOnCycleMessage.c_str());
diff --git a/src/misc.cpp b/src/misc.cpp
index 54e8bec78..9e1599bf8 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -1286,7 +1286,7 @@ const Anope::string Anope::LastError()
char errbuf[513];
DWORD err = GetLastError();
if (!err)
- return NULL;
+ return "";
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, 0, errbuf, 512, NULL);
return errbuf;
#endif
diff --git a/src/modules.cpp b/src/modules.cpp
index 0f6771c3a..a76f2c5da 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -11,7 +11,10 @@
#include "modules.h"
#include "version.h"
-#include <libintl.h>
+
+#if GETTEXT_FOUND
+# include <libintl.h>
+#endif
message_map MessageMap;
std::list<Module *> Modules;
@@ -261,7 +264,7 @@ void ModuleRunTimeDirCleanUp()
{
Anope::string filebuf = dirbuf + "/" + FileData.cFileName;
if (!DeleteFile(filebuf.c_str()))
- Log(LOG_DEBUG) << "Error deleting file " << filebuf << " - GetLastError() reports " << LastError();
+ Log(LOG_DEBUG) << "Error deleting file " << filebuf << " - GetLastError() reports " << Anope::LastError();
}
if (!FindNextFile(hList, &FileData))
{