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

Marvin Scholz git at videolan.org
Sun Jul 28 08:36:09 CEST 2019


vlc | branch: master | Marvin Scholz <epirat07 at gmail.com> | Fri Jul 26 21:34:48 2019 +0200| [1e5d3b1c97dc8b1b487dda21698117b6476fc44f] | committer: Jean-Baptiste Kempf

access/http: Fix tests compilation for Windows

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e5d3b1c97dc8b1b487dda21698117b6476fc44f
---

 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



More information about the vlc-commits mailing list