Subject: Re: [PATCH 1/5] msvc: Fix compilation errors caused by poll.h emulation

From: Sven Strickroth <[email-masked]>
Date: Thu, 09 May 2013 03:42:20 +0200

Am 31.01.2013 19:28 schrieb Ramsay Jones:
> Commit 0f77dea9 ("mingw: move poll out of sys-folder", 24-10-2011), along
> with other commits in the 'ef/mingw-upload-archive' branch (see commit
> 7406aa20), effectively reintroduced the same problem addressed by commit
> 56fb3ddc ("msvc: Fix compilation errors in compat/win32/sys/poll.c",
> 04-12-2010).
> 
> In order to fix the compilation errors, we use the same solution adopted
> in that earlier commit. In particular, we set _WIN32_WINNT to 0x0502
> (which would target Windows Server 2003) prior to including the winsock2.h
> header file.

This change causes problems compiling with MSVC2012 for me. If I don't
define NO_SYS_POLL_H git-compat-util.h now tries to include <sys/poll.h>
which does not exist for MSVC and if I define NO_SYS_POLL_H
git-compat-util.h now tries to include <poll.h> which also doesn't exist
for MSVC.

Including compat/poll into the includes path causes redefinition errors.

How have you tested this?

I think the check in git-compat-util.h has to be extended to only
include any poll.h if _MSC_VER is defined.

-- 
Best regards,
 Sven Strickroth
 PGP key id F5A9D4C4 @ any key-server