summaryrefslogtreecommitdiffstats
path: root/src/include/port/win32/sys/socket.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/port/win32/sys/socket.h')
-rw-r--r--src/include/port/win32/sys/socket.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/include/port/win32/sys/socket.h b/src/include/port/win32/sys/socket.h
new file mode 100644
index 0000000..0c32c0f
--- /dev/null
+++ b/src/include/port/win32/sys/socket.h
@@ -0,0 +1,26 @@
+/*
+ * src/include/port/win32/sys/socket.h
+ */
+#ifndef WIN32_SYS_SOCKET_H
+#define WIN32_SYS_SOCKET_H
+
+/*
+ * Unfortunately, <wingdi.h> of VC++ also defines ERROR.
+ * To avoid the conflict, we include <windows.h> here and undefine ERROR
+ * immediately.
+ *
+ * Note: Don't include <wingdi.h> directly. It causes compile errors.
+ */
+#include <winsock2.h>
+#include <ws2tcpip.h>
+#include <windows.h>
+
+#undef ERROR
+#undef small
+
+/* Restore old ERROR value */
+#ifdef PGERROR
+#define ERROR PGERROR
+#endif
+
+#endif /* WIN32_SYS_SOCKET_H */