[vlc-devel] [PATCH] contrib: gnutls: fix building for Winstore on 8.1
Steve Lhomme
robux4 at videolabs.io
Tue Oct 24 13:59:53 CEST 2017
Force the desktop API's for wincrypt
---
contrib/src/gnutls/gnutls-win81.patch | 48 +++++++++++++++++++++++++++++++++++
contrib/src/gnutls/rules.mak | 1 +
2 files changed, 49 insertions(+)
create mode 100644 contrib/src/gnutls/gnutls-win81.patch
diff --git a/contrib/src/gnutls/gnutls-win81.patch b/contrib/src/gnutls/gnutls-win81.patch
new file mode 100644
index 0000000000..220a8e9c19
--- /dev/null
+++ b/contrib/src/gnutls/gnutls-win81.patch
@@ -0,0 +1,48 @@
+--- gnutls/lib/gnutls_x509.c 2017-07-12 09:52:10.588755500 +0200
++++ gnutls/lib/gnutls_x509.c.msvc81 2017-10-09 13:03:43.073793700 +0200
+@@ -48,6 +48,8 @@
+ #include "system-keys.h"
+ #include "urls.h"
+ #ifdef _WIN32
++#undef WINAPI_FAMILY
++#define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
+ #include <wincrypt.h>
+ #endif
+
+--- gnutls/lib/nettle/rnd-common.c 2015-01-19 18:38:09.000000000 +0100
++++ gnutls/lib/nettle/rnd-common.c.msvc81 2017-10-09 13:20:15.025872800 +0200
+@@ -27,6 +27,10 @@
+ * and modified to fit gnutls' needs. Relicenced with permission.
+ * Original author Niels Möller.
+ */
++
++ #ifdef _WIN32
++#include <wincrypt.h>
++#endif
+
+ #include <gnutls_int.h>
+ #include <gnutls_errors.h>
+--- gnutls/lib/system.c 2017-07-12 09:52:10.349255600 +0200
++++ gnutls/lib/system.c.msvc81 2017-10-09 13:26:12.825712300 +0200
+@@ -20,6 +20,10 @@
+ *
+ */
+
++#ifdef _WIN32
++#include <wincrypt.h>
++#endif
++
+ #include <config.h>
+ #include <system.h>
+ #include <gnutls_int.h>
+@@ -32,8 +36,8 @@
+ #include <c-ctype.h>
+
+ #ifdef _WIN32
+-# include <windows.h>
+-# include <wincrypt.h>
++# undef WINAPI_FAMILY
++# define WINAPI_FAMILY WINAPI_FAMILY_DESKTOP_APP
+ # include <winapifamily.h>
+ # if (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
+ # if defined(_WIN32_WINNT) && _WIN32_WINNT >= 0x0A00 /* Univeral Winstore */
diff --git a/contrib/src/gnutls/rules.mak b/contrib/src/gnutls/rules.mak
index 41ba844d23..8dd04bc2a7 100644
--- a/contrib/src/gnutls/rules.mak
+++ b/contrib/src/gnutls/rules.mak
@@ -40,6 +40,7 @@ ifdef HAVE_MACOSX
$(APPLY) $(SRC)/gnutls/gnutls-disable-getentropy-osx.patch
endif
$(APPLY) $(SRC)/gnutls/gnutls-libidn.patch
+ $(APPLY) $(SRC)/gnutls/gnutls-win81.patch
$(call pkg_static,"lib/gnutls.pc.in")
$(UPDATE_AUTOCONFIG)
$(MOVE)
--
2.14.2
More information about the vlc-devel
mailing list