aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2014-12-12 11:19:59 +0200
committerEli Zaretskii2014-12-12 11:19:59 +0200
commit16d4c1cdc80528ae996a27deedbd88e79bc502b2 (patch)
tree01fa12cb3af0e43c337c9656adbdda2a5eaaaec5 /src
parent82ec808f0a0f4ddcf53b663c1ad7cee26814635c (diff)
downloademacs-16d4c1cdc80528ae996a27deedbd88e79bc502b2.tar.gz
emacs-16d4c1cdc80528ae996a27deedbd88e79bc502b2.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/gnutls.c29
2 files changed, 17 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 90139535e30..f8790a66d32 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12014-12-12 Eli Zaretskii <eliz@gnu.org>
2
3 * gnutls.c (Fgnutls_available_p, syms_of_gnutls): Move
4 gnutls-available-p out of the HAVE_GNUTLS conditional, and define
5 them only once.
6
12014-12-11 Teodor Zlatanov <tzz@lifelogs.com> 72014-12-11 Teodor Zlatanov <tzz@lifelogs.com>
2 8
3 * emacs.c (main): Always include gnutls.h and run syms_of_gnutls. 9 * emacs.c (main): Always include gnutls.h and run syms_of_gnutls.
diff --git a/src/gnutls.c b/src/gnutls.c
index d1713d379a9..247e5c42d48 100644
--- a/src/gnutls.c
+++ b/src/gnutls.c
@@ -1158,11 +1158,14 @@ This function may also return `gnutls-e-again', or
1158 return gnutls_make_error (ret); 1158 return gnutls_make_error (ret);
1159} 1159}
1160 1160
1161#endif /* HAVE_GNUTLS */
1162
1161DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0, 1163DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
1162 doc: /* Return t if GnuTLS is available in this instance of Emacs. */) 1164 doc: /* Return t if GnuTLS is available in this instance of Emacs. */)
1163 (void) 1165 (void)
1164{ 1166{
1165#ifdef WINDOWSNT 1167#ifdef HAVE_GNUTLS
1168# ifdef WINDOWSNT
1166 Lisp_Object found = Fassq (Qgnutls_dll, Vlibrary_cache); 1169 Lisp_Object found = Fassq (Qgnutls_dll, Vlibrary_cache);
1167 if (CONSP (found)) 1170 if (CONSP (found))
1168 return XCDR (found); 1171 return XCDR (found);
@@ -1173,14 +1176,18 @@ DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
1173 Vlibrary_cache = Fcons (Fcons (Qgnutls_dll, status), Vlibrary_cache); 1176 Vlibrary_cache = Fcons (Fcons (Qgnutls_dll, status), Vlibrary_cache);
1174 return status; 1177 return status;
1175 } 1178 }
1176#else 1179# else /* !WINDOWSNT */
1177 return Qt; 1180 return Qt;
1178#endif 1181# endif /* !WINDOWSNT */
1182#else /* !HAVE_GNUTLS */
1183 return Qnil;
1184#endif /* !HAVE_GNUTLS */
1179} 1185}
1180 1186
1181void 1187void
1182syms_of_gnutls (void) 1188syms_of_gnutls (void)
1183{ 1189{
1190#ifdef HAVE_GNUTLS
1184 gnutls_global_initialized = 0; 1191 gnutls_global_initialized = 0;
1185 1192
1186 DEFSYM (Qgnutls_dll, "gnutls"); 1193 DEFSYM (Qgnutls_dll, "gnutls");
@@ -1222,7 +1229,6 @@ syms_of_gnutls (void)
1222 defsubr (&Sgnutls_boot); 1229 defsubr (&Sgnutls_boot);
1223 defsubr (&Sgnutls_deinit); 1230 defsubr (&Sgnutls_deinit);
1224 defsubr (&Sgnutls_bye); 1231 defsubr (&Sgnutls_bye);
1225 defsubr (&Sgnutls_available_p);
1226 1232
1227 DEFVAR_INT ("gnutls-log-level", global_gnutls_log_level, 1233 DEFVAR_INT ("gnutls-log-level", global_gnutls_log_level,
1228 doc: /* Logging level used by the GnuTLS functions. 1234 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.
12301 is for important messages, 2 is for debug data, and higher numbers 12361 is for important messages, 2 is for debug data, and higher numbers
1231are as per the GnuTLS logging conventions. */); 1237are as per the GnuTLS logging conventions. */);
1232 global_gnutls_log_level = 0; 1238 global_gnutls_log_level = 0;
1233}
1234 1239
1235#else 1240#endif /* HAVE_GNUTLS */
1236 1241
1237DEFUN ("gnutls-available-p", Fgnutls_available_p, Sgnutls_available_p, 0, 0, 0,
1238 doc: /* Return t if GnuTLS is available in this instance of Emacs. */)
1239 (void)
1240{
1241 return Qnil;
1242}
1243
1244void
1245syms_of_gnutls (void)
1246{
1247 defsubr (&Sgnutls_available_p); 1242 defsubr (&Sgnutls_available_p);
1248} 1243}
1249
1250#endif /* HAVE_GNUTLS */