diff options
| author | Adam <Adam@anope.org> | 2011-08-10 01:32:07 -0400 |
|---|---|---|
| committer | Adam <Adam@anope.org> | 2011-08-10 01:32:07 -0400 |
| commit | ded98ed3ded63aa37b7226cd7228b375df8b33e3 (patch) | |
| tree | 83e728dddd3b886d198908979a72916727d71ad1 /src/win32 | |
| parent | 13bcc4ef14c0c61e8ed578ac9346291ae731b8df (diff) | |
Fixed windows build
Diffstat (limited to 'src/win32')
| -rw-r--r-- | src/win32/anope_windows.h | 10 | ||||
| -rw-r--r-- | src/win32/windows.cpp | 15 |
2 files changed, 24 insertions, 1 deletions
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 |
