From ded98ed3ded63aa37b7226cd7228b375df8b33e3 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 10 Aug 2011 01:32:07 -0400 Subject: Fixed windows build --- src/win32/anope_windows.h | 10 ++++++++++ src/win32/windows.cpp | 15 ++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'src/win32') diff --git a/src/win32/anope_windows.h b/src/win32/anope_windows.h index 6d16e5554..4fe1b11e5 100644 --- a/src/win32/anope_windows.h +++ b/src/win32/anope_windows.h @@ -41,6 +41,15 @@ #define snprintf _snprintf /* VS2008 hates having this define before its own */ #define vsnprintf _vsnprintf +#define stat _stat +#define S_ISREG(x) ((x) & _S_IFREG) + +#include "sigaction/sigaction.h" + +namespace Anope +{ + class string; +} extern CoreExport void OnStartup(); extern CoreExport void OnShutdown(); @@ -50,6 +59,7 @@ extern CoreExport const char *inet_ntop(int af, const void *src, char *dst, size extern CoreExport int gettimeofday(timeval *tv, void *); extern CoreExport Anope::string GetWindowsVersion(); extern CoreExport bool SupportedWindowsVersion(); +extern int mkstemp(char *input); #endif // _WIN32 #endif // WINDOWS_H diff --git a/src/win32/windows.cpp b/src/win32/windows.cpp index 265b5601b..60edaffbc 100644 --- a/src/win32/windows.cpp +++ b/src/win32/windows.cpp @@ -34,7 +34,7 @@ WindowsLanguage WindowsLanguages[] = { {NULL, 0} }; -WSADATA SocketEngine::wsa; +WSADATA wsa; void OnStartup() { @@ -302,4 +302,17 @@ bool SupportedWindowsVersion() return false; } +int mkstemp(char *input) +{ + input = _mktemp(input); + if (input == NULL) + { + errno = EEXIST; + return -1; + } + + int fd = open(input, O_WRONLY | O_CREAT, S_IREAD | S_IWRITE); + return fd; +} + #endif -- cgit