From: Chris Zheng Date: Sat, 11 Apr 2015 15:06:52 +0000 (+0300) Subject: Support GnuTLS v3.4 and later on MS-Windows X-Git-Tag: emacs-25.0.90~2488 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dc79845aac339db1cdcbbfc48d8f1569ed9a5aa2;p=emacs.git Support GnuTLS v3.4 and later on MS-Windows * src/gnutls.c (syms_of_gnutls) : New DEFSYM. * lisp/term/w32-win.el (dynamic-library-alist): Determine which GnuTLS DLL to load according to value of libgnutls-version. Fixes: bug#20294 Copyright-paperwork-exempt: yes --- diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index b5e6ff34743..b0667e6c4f7 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el @@ -214,6 +214,8 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") (defvar libgif-version) (defvar libjpeg-version) +(defvar libgnutls-version) ; gnutls.c + ;;; Set default known names for external libraries (setq dynamic-library-alist (list @@ -266,7 +268,9 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") '(glib "libglib-2.0-0.dll") '(gobject "libgobject-2.0-0.dll") - '(gnutls "libgnutls-28.dll" "libgnutls-26.dll") + (if (>= libgnutls-version 30400) + '(gnutls "libgnutls-30.dll") + '(gnutls "libgnutls-28.dll" "libgnutls-26.dll")) '(libxml2 "libxml2-2.dll" "libxml2.dll") '(zlib "zlib1.dll" "libz-1.dll"))) diff --git a/src/gnutls.c b/src/gnutls.c index 35f0eb48bc1..ddd36a91e9f 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -1645,6 +1645,16 @@ DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, void syms_of_gnutls (void) { + DEFSYM (Qlibgnutls_version, "libgnutls-version"); + Fset (Qlibgnutls_version, +#ifdef HAVE_GNUTLS + make_number (GNUTLS_VERSION_MAJOR * 10000 + + GNUTLS_VERSION_MINOR * 100 + + GNUTLS_VERSION_PATCH) +#else + make_number (-1) +#endif + ); #ifdef HAVE_GNUTLS gnutls_global_initialized = 0;