emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-24 16d4c1c: A better fix for bug#19346


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-24 16d4c1c: A better fix for bug#19346
Date: Fri, 12 Dec 2014 09:20:44 +0000

branch: emacs-24
commit 16d4c1cdc80528ae996a27deedbd88e79bc502b2
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    A better fix for bug#19346
    
     src/gnutls.c (Fgnutls_available_p, syms_of_gnutls): Move
     gnutls-available-p out of the HAVE_GNUTLS conditional, and define
     them only once.
---
 src/ChangeLog |    6 ++++++
 src/gnutls.c  |   29 +++++++++++------------------
 2 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 9013953..f8790a6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2014-12-12  Eli Zaretskii  <address@hidden>
+
+       * gnutls.c (Fgnutls_available_p, syms_of_gnutls): Move
+       gnutls-available-p out of the HAVE_GNUTLS conditional, and define
+       them only once.
+
 2014-12-11  Teodor Zlatanov  <address@hidden>
 
        * emacs.c (main): Always include gnutls.h and run syms_of_gnutls.
diff --git a/src/gnutls.c b/src/gnutls.c
index d1713d3..247e5c4 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1158,11 +1158,14 @@ This function may also return `gnutls-e-again', or
   return gnutls_make_error (ret);
 }
 
+#endif /* HAVE_GNUTLS */
+
 DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
        doc: /* Return t if GnuTLS is available in this instance of Emacs.  */)
      (void)
 {
-#ifdef WINDOWSNT
+#ifdef HAVE_GNUTLS
+# ifdef WINDOWSNT
   Lisp_Object found = Fassq (Qgnutls_dll, Vlibrary_cache);
   if (CONSP (found))
     return XCDR (found);
@@ -1173,14 +1176,18 @@ DEFUN ("gnutls-available-p", Fgnutls_available_p, 
Sgnutls_available_p, 0, 0, 0,
       Vlibrary_cache = Fcons (Fcons (Qgnutls_dll, status), Vlibrary_cache);
       return status;
     }
-#else
+# else /* !WINDOWSNT */
   return Qt;
-#endif
+# endif         /* !WINDOWSNT */
+#else  /* !HAVE_GNUTLS */
+  return Qnil;
+#endif /* !HAVE_GNUTLS */
 }
 
 void
 syms_of_gnutls (void)
 {
+#ifdef HAVE_GNUTLS
   gnutls_global_initialized = 0;
 
   DEFSYM (Qgnutls_dll, "gnutls");
@@ -1222,7 +1229,6 @@ syms_of_gnutls (void)
   defsubr (&Sgnutls_boot);
   defsubr (&Sgnutls_deinit);
   defsubr (&Sgnutls_bye);
-  defsubr (&Sgnutls_available_p);
 
   DEFVAR_INT ("gnutls-log-level", global_gnutls_log_level,
              doc: /* Logging level used by the GnuTLS functions.
@@ -1230,21 +1236,8 @@ Set this larger than 0 to get debug output in the 
*Messages* buffer.
 1 is for important messages, 2 is for debug data, and higher numbers
 are as per the GnuTLS logging conventions.  */);
   global_gnutls_log_level = 0;
-}
 
-#else
+#endif /* HAVE_GNUTLS */
 
-DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
-       doc: /* Return t if GnuTLS is available in this instance of Emacs.  */)
-     (void)
-{
-  return Qnil;
-}
-
-void
-syms_of_gnutls (void)
-{
   defsubr (&Sgnutls_available_p);
 }
-
-#endif /* HAVE_GNUTLS */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]