summaryrefslogtreecommitdiff
path: root/src/win32/anope_windows.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-11-08 17:29:16 -0500
committerAdam <Adam@anope.org>2011-11-08 17:29:16 -0500
commitb5ff856f47d8e54d12c568462a06351633c29610 (patch)
treea4e2f96c59ee49aa5e6cacdfd30db6155151ad36 /src/win32/anope_windows.h
parent97b9055f92f21cd91af44a3d5dacce0024536cff (diff)
Windows
Diffstat (limited to 'src/win32/anope_windows.h')
-rw-r--r--src/win32/anope_windows.h146
1 files changed, 75 insertions, 71 deletions
diff --git a/src/win32/anope_windows.h b/src/win32/anope_windows.h
index a631a4a70..cd5215298 100644
--- a/src/win32/anope_windows.h
+++ b/src/win32/anope_windows.h
@@ -1,71 +1,75 @@
- /* POSIX emulation layer for Windows.
- *
- * Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
- * Copyright (C) 2008-2011 Anope Team <info@anope.org>
- *
- * Please read COPYING and README for further details.
- *
- * Based on the original code of Epona by Lara.
- * Based on the original code of Services by Andy Church.
- */
-
- #ifndef WINDOWS_H
- #define WINDOWS_H
- #ifdef _WIN32
-
-#include <winsock2.h>
-#include <ws2tcpip.h>
-#include <windows.h>
-#include <sys/timeb.h>
-#include <direct.h>
-#include <io.h>
-#ifdef MODULE_COMPILE
-# define CoreExport __declspec(dllimport)
-# define DllExport __declspec(dllexport)
-#else
-# define CoreExport __declspec(dllexport)
-# define DllExport __declspec(dllimport)
-#endif
-/* We have our own inet_pton and inet_ntop (Windows XP doesn't have its own) */
-#define inet_pton inet_pton_
-#define inet_ntop inet_ntop_
-#define setenv(x, y, z) SetEnvironmentVariable(x, y)
-#define unsetenv(x) SetEnvironmentVariable(x, NULL)
-#define MARK_DEPRECATED
-#if GETTEXT_FOUND
-/* Undefine some functions libintl defines */
-# undef snprintf
-# undef vsnprintf
-# undef printf
-#endif
-#define snprintf _snprintf
-/* VS2008 hates having this define before its own */
-#define vsnprintf _vsnprintf
-#define stat _stat
-#define getcwd(x, y) GetCurrentDirectory(y, x)
-#define getpid GetCurrentProcessId
-#define S_ISREG(x) ((x) & _S_IFREG)
-#ifdef EINPROGRESS
-# undef EINPROGRESS
-#endif
-#define EINPROGRESS WSAEWOULDBLOCK
-
-#include "sigaction/sigaction.h"
-
-namespace Anope
-{
- class string;
-}
-
-extern CoreExport void OnStartup();
-extern CoreExport void OnShutdown();
-extern CoreExport USHORT WindowsGetLanguage(const char *lang);
-extern CoreExport int inet_pton(int af, const char *src, void *dst);
-extern CoreExport const char *inet_ntop(int af, const void *src, char *dst, size_t 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
+ /* POSIX emulation layer for Windows.
+ *
+ * Copyright (C) 2008-2011 Robin Burchell <w00t@inspircd.org>
+ * Copyright (C) 2008-2011 Anope Team <info@anope.org>
+ *
+ * Please read COPYING and README for further details.
+ *
+ * Based on the original code of Epona by Lara.
+ * Based on the original code of Services by Andy Church.
+ */
+
+ #ifndef WINDOWS_H
+ #define WINDOWS_H
+ #ifdef _WIN32
+
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+#include <sys/timeb.h>
+#include <direct.h>
+
+#ifdef MODULE_COMPILE
+# define CoreExport __declspec(dllimport)
+# define DllExport __declspec(dllexport)
+#else
+# define CoreExport __declspec(dllexport)
+# define DllExport __declspec(dllimport)
+#endif
+
+#define MARK_DEPRECATED
+
+#if GETTEXT_FOUND
+/* Undefine some functions libintl defines */
+# undef snprintf
+# undef vsnprintf
+# undef printf
+#endif
+
+#define snprintf _snprintf
+/* VS2008 hates having this define before its own */
+#define vsnprintf _vsnprintf
+
+#define stat _stat
+#define S_ISREG(x) ((x) & _S_IFREG)
+
+#ifdef EINPROGRESS
+# undef EINPROGRESS
+#endif
+#define EINPROGRESS WSAEWOULDBLOCK
+
+#include "socket.h"
+#include "dir/dir.h"
+#include "dl/dl.h"
+#include "pipe/pipe.h"
+#include "pthread/pthread.h"
+#include "sigaction/sigaction.h"
+
+namespace Anope
+{
+ class string;
+}
+
+extern CoreExport void OnStartup();
+extern CoreExport void OnShutdown();
+extern CoreExport USHORT WindowsGetLanguage(const char *lang);
+extern CoreExport int gettimeofday(timeval *tv, void *);
+extern CoreExport Anope::string GetWindowsVersion();
+extern CoreExport bool SupportedWindowsVersion();
+extern int setenv(const char *name, const char *value, int overwrite);
+extern int unsetenv(const char *name);
+extern int mkstemp(char *input);
+extern void getcwd(char *buf, size_t sz);
+
+#endif // _WIN32
+#endif // WINDOWS_H