From 56fb3ddc89ab94c8b09d178a848cb553b4acf777 Mon Sep 17 00:00:00 2001 From: Ramsay Jones Date: Sat, 4 Dec 2010 18:54:28 +0000 Subject: [PATCH] msvc: Fix compilation errors in compat/win32/sys/poll.c The msvc winsock2.h header file conditionally defines or declares poll() related symbols which cause many macro redefinition errors, a struct type redefinition error and syntax errors. These symbols are defined in support of the WSAPoll() API, new in Windows Vista, when the symbol _WIN32_WINNT is defined and _WIN32_WINNT >= 0x0600. In order to avoid the compilation errors, we set _WIN32_WINNT to 0x0502 (which would target Windows Server 2003) prior to including the winsock2.h header file. Signed-off-by: Ramsay Jones Acked-by: Erik Faye-Lund Signed-off-by: Junio C Hamano --- compat/win32/sys/poll.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compat/win32/sys/poll.c b/compat/win32/sys/poll.c index 7e74ebe59..708a6c9be 100644 --- a/compat/win32/sys/poll.c +++ b/compat/win32/sys/poll.c @@ -34,6 +34,9 @@ #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ # define WIN32_NATIVE +# if defined (_MSC_VER) +# define _WIN32_WINNT 0x0502 +# endif # include # include # include -- 2.30.2