summaryrefslogtreecommitdiff
path: root/src/include/port/win32.h
diff options
context:
space:
mode:
authorAndrew Dunstan2011-12-10 20:35:41 +0000
committerAndrew Dunstan2011-12-10 20:35:41 +0000
commit1a0c76c32fe470142d3663dd84ac960d75a4e8db (patch)
treed783c0f17e41b6a627b3750e92bb60b301215a8b /src/include/port/win32.h
parentab7d4213f93f0ef0e45b9b9343725974f196b091 (diff)
Enable compiling with the mingw-w64 32 bit compiler.
Original patch by Lars Kanis, reviewed by Nishiyama Tomoaki and tweaked some by me. This compiler, or at least the latest version of it, is currently broken, and only passes the regression tests if built with -O0.
Diffstat (limited to 'src/include/port/win32.h')
-rw-r--r--src/include/port/win32.h26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index 34f40041298..afc96283ebc 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -31,7 +31,7 @@
* The Mingw64 headers choke if this is already defined - they
* define it themselves.
*/
-#if !defined(WIN64) || defined(WIN32_ONLY_COMPILER)
+#if !defined(__MINGW64_VERSION_MAJOR) || defined(WIN32_ONLY_COMPILER)
#define _WINSOCKAPI_
#endif
#include <winsock2.h>
@@ -225,9 +225,13 @@ int setitimer(int which, const struct itimerval * value, struct itimerval * ov
#define fseeko(stream, offset, origin) _fseeki64(stream, offset, origin)
#define ftello(stream) _ftelli64(stream)
#else
+#ifndef fseeko
#define fseeko(stream, offset, origin) fseeko64(stream, offset, origin)
+#endif
+#ifndef ftello
#define ftello(stream) ftello64(stream)
#endif
+#endif
/*
* Supplement to <sys/types.h>.
@@ -264,16 +268,36 @@ typedef int pid_t;
#undef EINTR
#define EINTR WSAEINTR
#define EAGAIN WSAEWOULDBLOCK
+#ifndef EMSGSIZE
#define EMSGSIZE WSAEMSGSIZE
+#endif
+#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#endif
+#ifndef EWOULDBLOCK
#define EWOULDBLOCK WSAEWOULDBLOCK
+#endif
+#ifndef ECONNRESET
#define ECONNRESET WSAECONNRESET
+#endif
+#ifndef EINPROGRESS
#define EINPROGRESS WSAEINPROGRESS
+#endif
+#ifndef ENOBUFS
#define ENOBUFS WSAENOBUFS
+#endif
+#ifndef EPROTONOSUPPORT
#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#endif
+#ifndef ECONNREFUSED
#define ECONNREFUSED WSAECONNREFUSED
+#endif
+#ifndef EBADFD
#define EBADFD WSAENOTSOCK
+#endif
+#ifndef EOPNOTSUPP
#define EOPNOTSUPP WSAEOPNOTSUPP
+#endif
/*
* Extended locale functions with gratuitous underscore prefixes.