1
0
mirror of https://github.com/anope/anope.git synced 2026-07-02 01:46:39 +02:00

Fixed Windows build

This commit is contained in:
Adam
2010-10-11 18:47:54 -04:00
parent 717c123441
commit d7aa5f6a3a
13 changed files with 34 additions and 27 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
#include "services.h"
#include "modules.h"
#include "anope.h"
Base::Base()
{
+3 -3
View File
@@ -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;
}
+8
View File
@@ -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());
+1 -1
View File
@@ -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
+5 -2
View File
@@ -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))
{