diff options
author | Adam <Adam@anope.org> | 2011-03-30 00:55:45 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2011-03-30 00:55:45 -0400 |
commit | 8098ed899a3648897c0de925c974e21883a76b8d (patch) | |
tree | b46ae9bc84943be1a73ebbb56502250f6afe0de6 /src/win32/anope_windows.h | |
parent | 77c98f0750da20bc565eb33b9a9d7bbbd1535006 (diff) |
Fixed windows build more, including ldap
Diffstat (limited to 'src/win32/anope_windows.h')
-rw-r--r-- | src/win32/anope_windows.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/win32/anope_windows.h b/src/win32/anope_windows.h new file mode 100644 index 000000000..3abe8bd13 --- /dev/null +++ b/src/win32/anope_windows.h @@ -0,0 +1,51 @@ + /* 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
+
+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, char *);
+
+ #endif // _WIN32
+ #endif // WINDOWS_H
\ No newline at end of file |