]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow Emacs on w32 to build against and work with GnuTLS 3.x.
authorEli Zaretskii <eliz@gnu.org>
Sun, 1 Jan 2012 16:26:51 +0000 (18:26 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 1 Jan 2012 16:26:51 +0000 (18:26 +0200)
 src/gnutls.c (init_gnutls_functions): Load gnutls_check_version.
 Load gnutls_transport_set_lowat only if GnuTLS version is below
 2.11.1.
 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
 GnuTLS versions below 2.11.1.
 lisp/term/w32-win.el (dynamic-library-alist) <gnutls>: Load
 libgnutls-28.dll, from GnuTLS version 3.x, in preference to
 libgnutls-26.dll.

lisp/ChangeLog
lisp/term/w32-win.el
src/ChangeLog
src/gnutls.c

index c7696651c671de5b32249c2b4cc86bf92002f7e7..5c9274fdda53ae6de6f3a3d3613339f39f6eff2a 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-01  Eli Zaretskii  <eliz@gnu.org>
+
+       * term/w32-win.el (dynamic-library-alist) <gnutls>: Load
+       libgnutls-28.dll, from GnuTLS version 3.x, in preference to
+       libgnutls-26.dll.
+
 2011-12-31  Andreas Schwab  <schwab@linux-m68k.org>
 
        * emacs-lisp/bytecomp.el (byte-compile-file): Fix indentation.
index b7f2a69e77bf725a0048fc321c21cee71a50dbf2..c7189d15241de5ad0de6b3043f2e16ba64baae49 100644 (file)
@@ -210,7 +210,7 @@ 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-26.dll")))
+       '(gnutls "libgnutls-28.dll" "libgnutls-26.dll")))
 
 ;;; multi-tty support
 (defvar w32-initialized nil
index 937b96107bc0d25873aa129d9d20362500a4975c..829895d1b726b8a9fd1c24b3789c9fe1bf30e897 100644 (file)
@@ -1,3 +1,11 @@
+2012-01-01  Eli Zaretskii  <eliz@gnu.org>
+
+       * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
+       Load gnutls_transport_set_lowat only if GnuTLS version is below
+       2.11.1.
+       (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
+       GnuTLS versions below 2.11.1.
+
 2011-12-31  Antoine Levitt  <antoine.levitt@gmail.com>
 
        * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
index 500f09432b1a1f6369a755aa711dac23392b1065..bcec07b36e6d3385deb95c5377e52be917308cfb 100644 (file)
@@ -125,6 +125,7 @@ DEF_GNUTLS_FN (ssize_t, gnutls_record_send,
               (gnutls_session_t, const void *, size_t));
 DEF_GNUTLS_FN (const char *, gnutls_strerror, (int));
 DEF_GNUTLS_FN (void, gnutls_transport_set_errno, (gnutls_session_t, int));
+DEF_GNUTLS_FN (const char *, gnutls_check_version, (const char *));
 DEF_GNUTLS_FN (void, gnutls_transport_set_lowat, (gnutls_session_t, int));
 DEF_GNUTLS_FN (void, gnutls_transport_set_ptr2,
               (gnutls_session_t, gnutls_transport_ptr_t,
@@ -184,7 +185,11 @@ init_gnutls_functions (Lisp_Object libraries)
   LOAD_GNUTLS_FN (library, gnutls_record_send);
   LOAD_GNUTLS_FN (library, gnutls_strerror);
   LOAD_GNUTLS_FN (library, gnutls_transport_set_errno);
-  LOAD_GNUTLS_FN (library, gnutls_transport_set_lowat);
+  LOAD_GNUTLS_FN (library, gnutls_check_version);
+  /* We don't need to call gnutls_transport_set_lowat in GnuTLS 2.11.1
+     and later, and the function was removed entirely in 3.0.0.  */
+  if (!fn_gnutls_check_version ("2.11.1"))
+    LOAD_GNUTLS_FN (library, gnutls_transport_set_lowat);
   LOAD_GNUTLS_FN (library, gnutls_transport_set_ptr2);
   LOAD_GNUTLS_FN (library, gnutls_transport_set_pull_function);
   LOAD_GNUTLS_FN (library, gnutls_transport_set_push_function);
@@ -282,7 +287,12 @@ emacs_gnutls_handshake (struct Lisp_Process *proc)
         (Note: this is probably not strictly necessary as the lowat
          value is only used when no custom pull/push functions are
          set.)  */
-      fn_gnutls_transport_set_lowat (state, 0);
+      /* According to GnuTLS NEWS file, lowat level has been set to
+        zero by default in version 2.11.1, and the function
+        gnutls_transport_set_lowat was removed from the library in
+        version 2.99.0.  */
+      if (!fn_gnutls_check_version ("2.11.1"))
+       fn_gnutls_transport_set_lowat (state, 0);
 #else
       /* This is how GnuTLS takes sockets: as file descriptors passed
         in.  For an Emacs process socket, infd and outfd are the