[vlc-devel] [PATCH] access/http: Fix tests compilation for Windows

Steve Lhomme robux4 at ycbcr.xyz
Mon Jul 29 08:23:19 CEST 2019


Hi,

On 2019-07-26 21:34, Marvin Scholz wrote:
> ---
>   modules/access/http/h1conn_test.c | 4 ++++
>   modules/access/http/h2conn_test.c | 4 ++++
>   modules/access/http/tunnel_test.c | 6 +++++-
>   3 files changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/modules/access/http/h1conn_test.c b/modules/access/http/h1conn_test.c
> index 139f9afa87..d908b4f846 100644
> --- a/modules/access/http/h1conn_test.c
> +++ b/modules/access/http/h1conn_test.c
> @@ -39,6 +39,10 @@
>   #include "conn.h"
>   #include "message.h"
>   
> +#if defined(PF_UNIX) && !defined(PF_LOCAL)
> +#    define PF_LOCAL PF_UNIX
> +#endif
> +

You might put that in vlc_network.h as it's already used elsewhere in 
the code (rc.c)

>   const char vlc_module_name[] = "test_h1conn";
>   
>   static struct vlc_http_conn *conn;
> diff --git a/modules/access/http/h2conn_test.c b/modules/access/http/h2conn_test.c
> index 6b0005f069..8e375d1009 100644
> --- a/modules/access/http/h2conn_test.c
> +++ b/modules/access/http/h2conn_test.c
> @@ -40,6 +40,10 @@
>   #include "conn.h"
>   #include "message.h"
>   
> +#if defined(PF_UNIX) && !defined(PF_LOCAL)
> +#    define PF_LOCAL PF_UNIX
> +#endif
> +
>   const char vlc_module_name[] = "test_h2conn";
>   
>   static struct vlc_http_conn *conn;
> diff --git a/modules/access/http/tunnel_test.c b/modules/access/http/tunnel_test.c
> index 8280a9202d..223085714e 100644
> --- a/modules/access/http/tunnel_test.c
> +++ b/modules/access/http/tunnel_test.c
> @@ -38,7 +38,11 @@
>   # define SOCK_CLOEXEC 0
>   # define accept4(a,b,c,d) accept(a,b,c)
>   #endif
> -#include <netinet/in.h>
> +#ifdef _WIN32
> +# include <winsock2.h>
> +#else
> +# include <netinet/in.h>
> +#endif

This is already handled in vlc_network.h. It should probably be included 
instead.

>   #ifdef HAVE_ARPA_INET_H
>   #include <arpa/inet.h>
>   #endif
> -- 
> 2.19.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
> 


More information about the vlc-devel mailing list