threads / patch / 61412

patchWin32: Fix building with NO_UNIX_SOCKETS

Subject: [PATCH] Win32: Fix building with NO_UNIX_SOCKETS

## tl;dr

3 messages between May 3, 2024 and May 3, 2024. Diffs are folded; open one to read it.

replies: 2people: 3as markdown or json

Mike Hommey· May 3, 2024, 09:14 UTC · lore
After 2406bf5fc5 it fails with:
compat/mingw.c:4160:5: error: no previous prototype for function 'mingw_have_unix_sockets' [-Werror,-Wmissing-prototypes]
   4160 | int mingw_have_unix_sockets(void)
        |     ^
because the prototype is behind `ifndef NO_UNIX_SOCKETS`
Signed-off-by: Mike Hommey <mh@glandium.org>
---
 compat/mingw.c | 2 ++
 1 file changed, 2 insertions(+)
Show changes to compat/mingw.c +2 −0
diff --git a/compat/mingw.c b/compat/mingw.c
index 4876344b5b..6b06ea540f 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -3159,6 +3159,7 @@ int uname(struct utsname *buf)
 	return 0;
 }
 
+#ifndef NO_UNIX_SOCKETS
 int mingw_have_unix_sockets(void)
 {
 	SC_HANDLE scm, srvc;
@@ -3177,3 +3178,4 @@ int mingw_have_unix_sockets(void)
 	}
 	return ret;
 }
+#endif
-- 
2.45.0.1.ge6f3e402ce
Johannes Schindelin· May 3, 2024, 09:26 UTC · re: Mike Hommey · lore

Re: [PATCH] Win32: Fix building with NO_UNIX_SOCKETS

Hi Mike,
On Fri, 3 May 2024, Mike Hommey wrote:
Show 7 quoted lines
> After 2406bf5fc5 it fails with:
>
> compat/mingw.c:4160:5: error: no previous prototype for function 'mingw_have_unix_sockets' [-Werror,-Wmissing-prototypes]
>    4160 | int mingw_have_unix_sockets(void)
>         |     ^
>
> because the prototype is behind `ifndef NO_UNIX_SOCKETS`
Good catch!
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>

Thank you, Johannes

Show 27 quoted lines
>
> Signed-off-by: Mike Hommey <mh@glandium.org>
> ---
>  compat/mingw.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/compat/mingw.c b/compat/mingw.c
> index 4876344b5b..6b06ea540f 100644
> --- a/compat/mingw.c
> +++ b/compat/mingw.c
> @@ -3159,6 +3159,7 @@ int uname(struct utsname *buf)
>  	return 0;
>  }
>
> +#ifndef NO_UNIX_SOCKETS
>  int mingw_have_unix_sockets(void)
>  {
>  	SC_HANDLE scm, srvc;
> @@ -3177,3 +3178,4 @@ int mingw_have_unix_sockets(void)
>  	}
>  	return ret;
>  }
> +#endif
> --
> 2.45.0.1.ge6f3e402ce
>
>
Junio C Hamano· May 3, 2024, 15:43 UTC · re: Johannes Schindelin · lore

Re: [PATCH] Win32: Fix building with NO_UNIX_SOCKETS

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 18 quoted lines
> Hi Mike,
>
> On Fri, 3 May 2024, Mike Hommey wrote:
>
>> After 2406bf5fc5 it fails with:
>>
>> compat/mingw.c:4160:5: error: no previous prototype for function 'mingw_have_unix_sockets' [-Werror,-Wmissing-prototypes]
>>    4160 | int mingw_have_unix_sockets(void)
>>         |     ^
>>
>> because the prototype is behind `ifndef NO_UNIX_SOCKETS`
>
> Good catch!
>
> Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>
> Thank you,
> Johannes
Thanks, both.  Will queue.
Show 28 quoted lines
>
>>
>> Signed-off-by: Mike Hommey <mh@glandium.org>
>> ---
>>  compat/mingw.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/compat/mingw.c b/compat/mingw.c
>> index 4876344b5b..6b06ea540f 100644
>> --- a/compat/mingw.c
>> +++ b/compat/mingw.c
>> @@ -3159,6 +3159,7 @@ int uname(struct utsname *buf)
>>  	return 0;
>>  }
>>
>> +#ifndef NO_UNIX_SOCKETS
>>  int mingw_have_unix_sockets(void)
>>  {
>>  	SC_HANDLE scm, srvc;
>> @@ -3177,3 +3178,4 @@ int mingw_have_unix_sockets(void)
>>  	}
>>  	return ret;
>>  }
>> +#endif
>> --
>> 2.45.0.1.ge6f3e402ce
>>
>>

← back to recent threads