threads / patch / 28974

patch, 3 partsMSVC: Remove vcbuild/include/sys/poll.h

Subject: [PATCH 1/3] MSVC: Remove vcbuild/include/sys/poll.h

## tl;dr

5 messages between Nov 18, 2011 and Nov 22, 2011. Diffs are folded; open one to read it.

replies: 4people: 2as markdown or json

Vincent van Ravesteijn· Nov 18, 2011, 16:44 UTC · lore

In v1.7.7.1-432-g0f77dea (Oct 24 2011; Erik Faye-Lund; mingw: move poll out of sys-folder) poll.h was moved out of the compat/win32/sys folder. As the change in the Makefile also affects the MSVC build, this file was no longer used.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
---
 compat/vcbuild/include/sys/poll.h |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
 delete mode 100644 compat/vcbuild/include/sys/poll.h
Show changes to compat/vcbuild/include/sys/poll.h +0 −1
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 */
-- 
1.7.4.1
Vincent van Ravesteijn· Nov 18, 2011, 16:44 UTC · re: Vincent van Ravesteijn · lore

[PATCH 2/3] Compile fix for MSVC: fix poll-related macro redefines

This seems to be related to the poll-emulation... I see that these things are guarded by an "#if(_WIN32_WINNT >= 0x0600)" in <winsock2.h>, which means it's supported for Windows Vista and above... We still support Windows XP, so it seems someone has set this too high :)

I'd prefer to set this from the Makefile, but this generates a warning in compat/win32/poll.c about redefining a macro (poll.c wants it to be 0x502, which is Windows XP with SP2, rather than 0x501 which is normal Windows XP).

Proposed-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Submitted-by: Vincent van Ravesteijn <vfr@lyx.org>
---
 compat/mingw.h    |    1 +
 git-compat-util.h |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
Show changes to 2 files +2 −0

compat/mingw.h, git-compat-util.h

diff --git a/compat/mingw.h b/compat/mingw.h
index fecf0d0..ff18401 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -1,3 +1,4 @@
+#define _WIN32_WINNT 0x0501
 #include <winsock2.h>
 #include <ws2tcpip.h>
 
diff --git a/git-compat-util.h b/git-compat-util.h
index 5ef8ff7..76cbfe6 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -85,6 +85,7 @@
 #define _SGI_SOURCE 1
 
 #ifdef WIN32 /* Both MinGW and MSVC */
+#  define _WIN32_WINNT 0x0501
 #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */
 #include <winsock2.h>
 #include <windows.h>
-- 
1.7.4.1
Sebastian Schuberth· Nov 18, 2011, 17:36 UTC · re: Vincent van Ravesteijn · lore

Re: [PATCH 2/3] Compile fix for MSVC: fix poll-related macro redefines

On 18.11.2011 17:44, Vincent van Ravesteijn wrote:
Show 12 quoted lines
> diff --git a/git-compat-util.h b/git-compat-util.h
> index 5ef8ff7..76cbfe6 100644
> --- a/git-compat-util.h
> +++ b/git-compat-util.h
> @@ -85,6 +85,7 @@
>  #define _SGI_SOURCE 1
>
>  #ifdef WIN32 /* Both MinGW and MSVC */
> +#  define _WIN32_WINNT 0x0501
>  #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */
>  #include<winsock2.h>
>  #include<windows.h>

It seems the indentation is wrong (does not match the surrounding code) here.

-- 
Sebastian Schuberth
Vincent van Ravesteijn· Nov 22, 2011, 07:30 UTC · re: Sebastian Schuberth · lore

Re: [PATCH 2/3] Compile fix for MSVC: fix poll-related macro redefines

Op 18-11-2011 18:36, Sebastian Schuberth schreef:
Show 18 quoted lines
> On 18.11.2011 17:44, Vincent van Ravesteijn wrote:
>
>> diff --git a/git-compat-util.h b/git-compat-util.h
>> index 5ef8ff7..76cbfe6 100644
>> --- a/git-compat-util.h
>> +++ b/git-compat-util.h
>> @@ -85,6 +85,7 @@
>>  #define _SGI_SOURCE 1
>>
>>  #ifdef WIN32 /* Both MinGW and MSVC */
>> +#  define _WIN32_WINNT 0x0501
>>  #define WIN32_LEAN_AND_MEAN  /* stops windows.h including winsock.h */
>>  #include<winsock2.h>
>>  #include<windows.h>
>
> It seems the indentation is wrong (does not match the surrounding 
> code) here.
>

Yes, you're right. I will reroll the patch series when there is somewhat more feedback on the series.

Vincent
Vincent van Ravesteijn· Nov 18, 2011, 16:44 UTC · re: Vincent van Ravesteijn · lore

[PATCH 3/3] Compile fix for MSVC: Use NO_INET_PTON and NO_INET_NTOP

This is needed to compile daemon.c.

In v1.7.3.2-162-ga666b47 (Nov 4 2010; Erik Faye-Lund <kusmabite@gmail.com>; daemon: opt-out on features that require posix) this was introduced for MingW, but this is also necessary for MSVC.

Signed-off-by: Vincent van Ravesteijn <vfr@lyx.org>
---
 Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
Show changes to Makefile +2 −0
diff --git a/Makefile b/Makefile
index ee34eab..b9d53aa 100644
--- a/Makefile
+++ b/Makefile
@@ -1120,6 +1120,8 @@ ifeq ($(uname_S),Windows)
 	BLK_SHA1 = YesPlease
 	NO_POSIX_GOODIES = UnfortunatelyYes
 	NATIVE_CRLF = YesPlease
+	NO_INET_PTON = YesPlease
+	NO_INET_NTOP = YesPlease
 
 	CC = compat/vcbuild/scripts/clink.pl
 	AR = compat/vcbuild/scripts/lib.pl
-- 
1.7.4.1

← back to recent threads