git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/5] msvc: Fix compilation errors caused by poll.h emulation
@ 2013-01-31 18:28 Ramsay Jones
  2013-05-09  1:42 ` Sven Strickroth
  0 siblings, 1 reply; 4+ messages in thread
From: Ramsay Jones @ 2013-01-31 18:28 UTC (permalink / raw)
  To: GIT Mailing-list
  Cc: Junio C Hamano, Erik Faye-Lund, Jonathan Nieder, Johannes Sixt,
	Johannes Schindelin


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.

Also, we delete the compat/vcbuild/include/sys/poll.h header file, since
it is now redundant and it's presence may cause some confusion.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 compat/vcbuild/include/sys/poll.h | 1 -
 git-compat-util.h                 | 3 +++
 2 files changed, 3 insertions(+), 1 deletion(-)
 delete mode 100644 compat/vcbuild/include/sys/poll.h

diff --git a/compat/vcbuild/include/sys/poll.h b/compat/vcbuild/include/sys/poll.h
deleted file mode 100644
index 0d8552a..0000000
--- a/compat/vcbuild/include/sys/poll.h
+++ /dev/null
@@ -1 +0,0 @@
-/* Intentionally empty file to support building git with MSVC */
diff --git a/git-compat-util.h b/git-compat-util.h
index cc2abee..204cb1e 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -86,6 +86,9 @@
 #define _SGI_SOURCE 1
 
 #ifdef WIN32 /* Both MinGW and MSVC */
+# if defined (_MSC_VER)
+#  define _WIN32_WINNT 0x0502
+# endif
 #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */
 #include <winsock2.h>
 #include <windows.h>
-- 
1.8.1

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

end of thread, other threads:[~2013-05-09 21:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-31 18:28 [PATCH 1/5] msvc: Fix compilation errors caused by poll.h emulation Ramsay Jones
2013-05-09  1:42 ` Sven Strickroth
2013-05-09 20:35   ` Ramsay Jones
2013-05-09 21:12     ` Sven Strickroth

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).