[Box Backup-commit] COMMIT r2873 - box/trunk/lib/win32

subversion at boxbackup.org subversion at boxbackup.org
Sat Mar 26 23:21:04 GMT 2011


Author: chris
Date: 2011-03-26 23:21:03 +0000 (Sat, 26 Mar 2011)
New Revision: 2873

Modified:
   box/trunk/lib/win32/emu.h
Log:
Define WINVER and _WIN32_WINNT to Windows 2000 to avoid importing WSAPoll
from winsock2.h, which conflicts with our definition of struct pollfd,
on Windows Vista and above.


Modified: box/trunk/lib/win32/emu.h
===================================================================
--- box/trunk/lib/win32/emu.h	2011-03-26 14:32:01 UTC (rev 2872)
+++ box/trunk/lib/win32/emu.h	2011-03-26 23:21:03 UTC (rev 2873)
@@ -50,6 +50,23 @@
 #define __MSVCRT_VERSION__ 0x0601
 #endif
 
+// WIN32_WINNT versions 0x0600 (Vista) and higher enable WSAPoll() in
+// winsock2.h, whose struct pollfd conflicts with ours below, so for
+// now we just set it lower than that, to Windows 2000.
+#ifdef WINVER
+	#if WINVER != 0x0500
+		#error Must include emu.h before setting WINVER
+	#endif
+#endif
+#define WINVER 0x0500
+
+#ifdef _WIN32_WINNT
+	#if _WIN32_WINNT != 0x0500
+		#error Must include emu.h before setting _WIN32_WINNT
+	#endif
+#endif
+#define _WIN32_WINNT 0x0500
+
 // Windows headers
 
 #include <winsock2.h>
@@ -286,10 +303,19 @@
 }
 
 #define INFTIM -1
-#define POLLIN 0x1
-#define POLLERR 0x8
-#define POLLOUT 0x4
 
+#ifndef POLLIN
+#	define POLLIN 0x1
+#endif
+
+#ifndef POLLERR
+#	define POLLERR 0x8
+#endif
+
+#ifndef POLLOUT
+#	define POLLOUT 0x4
+#endif
+
 #define SHUT_RDWR SD_BOTH
 #define SHUT_RD SD_RECEIVE
 #define SHUT_WR SD_SEND




More information about the Boxbackup-commit mailing list