summaryrefslogtreecommitdiff
path: root/src/include/port/win32.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/port/win32.h')
-rw-r--r--src/include/port/win32.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/include/port/win32.h b/src/include/port/win32.h
index afc96283ebc..e2dd23b284a 100644
--- a/src/include/port/win32.h
+++ b/src/include/port/win32.h
@@ -103,7 +103,9 @@
#define IPC_STAT 4096
#define EACCESS 2048
+#ifndef EIDRM
#define EIDRM 4096
+#endif
#define SETALL 8192
#define GETNCNT 16384
@@ -300,6 +302,26 @@ typedef int pid_t;
#endif
/*
+ * For Microsoft Visual Studio 2010 and above we intentionally redefine
+ * the regular Berkeley error constants and set them to the WSA constants.
+ * Note that this will break if those constants are used for anything else
+ * than Windows Sockets errors.
+ */
+#if _MSC_VER >= 1600
+#pragma warning(disable:4005)
+#define EMSGSIZE WSAEMSGSIZE
+#define EAFNOSUPPORT WSAEAFNOSUPPORT
+#define EWOULDBLOCK WSAEWOULDBLOCK
+#define EPROTONOSUPPORT WSAEPROTONOSUPPORT
+#define ECONNRESET WSAECONNRESET
+#define EINPROGRESS WSAEINPROGRESS
+#define ENOBUFS WSAENOBUFS
+#define ECONNREFUSED WSAECONNREFUSED
+#define EOPNOTSUPP WSAEOPNOTSUPP
+#pragma warning(default:4005)
+#endif
+
+/*
* Extended locale functions with gratuitous underscore prefixes.
* (These APIs are nevertheless fully documented by Microsoft.)
*/