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

Marvin Scholz epirat07 at gmail.com
Fri Jul 26 21:34:48 CEST 2019


---
 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
+
 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
 #ifdef HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #endif
-- 
2.19.1



More information about the vlc-devel mailing list