aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorAndrew Dunstan <andrew@dunslane.net>2012-01-03 08:44:26 -0500
committerAndrew Dunstan <andrew@dunslane.net>2012-01-03 08:44:26 -0500
commit63876d3bac5a7471a7987da25a93c13a2534a644 (patch)
treebc5b7db72bfb0514e50bc0f61dc279ea21561962 /src/include
parentf132824c24c46d2efab49b4cddd1088781bf499e (diff)
downloadpostgresql-63876d3bac5a7471a7987da25a93c13a2534a644.tar.gz
postgresql-63876d3bac5a7471a7987da25a93c13a2534a644.zip
Support for building with MS Visual Studio 2010.
Brar Piening, reviewed by Craig Ringer.
Diffstat (limited to 'src/include')
-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.)
*/