Always define `gnutls-available-p' even if GnuTLS is not available.
Fixes: debbugs:19346 * gnutls.c (Fgnutls_available_p syms_of_gnutls): Move later for clarity. Let the availability check return Qnil when the GnuTLS integration is not available, instead of erroring out. * gnutls.h: Always declare syms_of_gnutls. * emacs.c (main): Always include gnutls.h and run syms_of_gnutls.
This commit is contained in:
parent
d76b9b2a21
commit
301a4014a7
4 changed files with 48 additions and 27 deletions
|
@ -1,3 +1,14 @@
|
|||
2014-12-11 Teodor Zlatanov <tzz@lifelogs.com>
|
||||
|
||||
* emacs.c (main): Always include gnutls.h and run syms_of_gnutls.
|
||||
|
||||
* gnutls.h: Always declare syms_of_gnutls.
|
||||
|
||||
* gnutls.c (Fgnutls_available_p syms_of_gnutls): Move later for
|
||||
clarity. Let the availability check return Qnil when the GnuTLS
|
||||
integration is not available, instead of erroring out.
|
||||
(Bug#19346)
|
||||
|
||||
2014-12-10 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* xdisp.c (move_it_in_display_line_to, display_line): Don't
|
||||
|
|
|
@ -82,9 +82,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
|||
#include "syntax.h"
|
||||
#include "systime.h"
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
#include "gnutls.h"
|
||||
#endif
|
||||
|
||||
#if (defined PROFILING \
|
||||
&& (defined __FreeBSD__ || defined GNU_LINUX || defined __MINGW32__))
|
||||
|
@ -1502,9 +1500,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem
|
|||
syms_of_fontset ();
|
||||
#endif /* HAVE_NS */
|
||||
|
||||
#ifdef HAVE_GNUTLS
|
||||
syms_of_gnutls ();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GFILENOTIFY
|
||||
syms_of_gfilenotify ();
|
||||
|
|
56
src/gnutls.c
56
src/gnutls.c
|
@ -673,27 +673,6 @@ See also `gnutls-init'. */)
|
|||
return emacs_gnutls_deinit (proc);
|
||||
}
|
||||
|
||||
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
|
||||
Lisp_Object found = Fassq (Qgnutls_dll, Vlibrary_cache);
|
||||
if (CONSP (found))
|
||||
return XCDR (found);
|
||||
else
|
||||
{
|
||||
Lisp_Object status;
|
||||
status = init_gnutls_functions () ? Qt : Qnil;
|
||||
Vlibrary_cache = Fcons (Fcons (Qgnutls_dll, status), Vlibrary_cache);
|
||||
return status;
|
||||
}
|
||||
#else
|
||||
return Qt;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* Initializes global GnuTLS state to defaults.
|
||||
Call `gnutls-global-deinit' when GnuTLS usage is no longer needed.
|
||||
Returns zero on success. */
|
||||
|
@ -1179,6 +1158,26 @@ This function may also return `gnutls-e-again', or
|
|||
return gnutls_make_error (ret);
|
||||
}
|
||||
|
||||
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
|
||||
Lisp_Object found = Fassq (Qgnutls_dll, Vlibrary_cache);
|
||||
if (CONSP (found))
|
||||
return XCDR (found);
|
||||
else
|
||||
{
|
||||
Lisp_Object status;
|
||||
status = init_gnutls_functions () ? Qt : Qnil;
|
||||
Vlibrary_cache = Fcons (Fcons (Qgnutls_dll, status), Vlibrary_cache);
|
||||
return status;
|
||||
}
|
||||
#else
|
||||
return Qt;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
syms_of_gnutls (void)
|
||||
{
|
||||
|
@ -1233,4 +1232,19 @@ are as per the GnuTLS logging conventions. */);
|
|||
global_gnutls_log_level = 0;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
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 */
|
||||
|
|
|
@ -82,8 +82,8 @@ extern void emacs_gnutls_transport_set_errno (gnutls_session_t state, int err);
|
|||
#endif
|
||||
extern Lisp_Object emacs_gnutls_deinit (Lisp_Object);
|
||||
|
||||
#endif
|
||||
|
||||
extern void syms_of_gnutls (void);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue