Skip to content

Commit

Permalink
Support GnuTLS v3.4 and later on MS-Windows
Browse files Browse the repository at this point in the history
* src/gnutls.c (syms_of_gnutls) <libgnutls-version>: 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
  • Loading branch information
Chris Zheng authored and Eli-Zaretskii committed Apr 11, 2015
1 parent 279558f commit dc79845
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lisp/term/w32-win.el
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")))

Expand Down
10 changes: 10 additions & 0 deletions src/gnutls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit dc79845

Please sign in to comment.