git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/14] msvc: Fix compilation errors in compat/win32/sys/poll.c
@ 2010-12-04 18:54 Ramsay Jones
  2010-12-04 20:45 ` Jonathan Nieder
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Ramsay Jones @ 2010-12-04 18:54 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Johannes Sixt, kusmabite, GIT Mailing-list


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 <ramsay@ramsay1.demon.co.uk>
---
 compat/win32/sys/poll.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/compat/win32/sys/poll.c b/compat/win32/sys/poll.c
index 7e74ebe..708a6c9 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 <winsock2.h>
 # include <windows.h>
 # include <io.h>
-- 
1.7.3

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-12-11 22:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-04 18:54 [PATCH 01/14] msvc: Fix compilation errors in compat/win32/sys/poll.c Ramsay Jones
2010-12-04 20:45 ` Jonathan Nieder
2010-12-07 22:54   ` Ramsay Jones
2010-12-04 21:12 ` Erik Faye-Lund
2010-12-04 21:22 ` Johannes Sixt
2010-12-08  0:18   ` Ramsay Jones
2010-12-08 19:42     ` Johannes Sixt
     [not found]       ` <4D039E73.80301@ramsay1.demon.co.uk>
2010-12-11 22:09         ` Johannes Sixt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).