From 162f375bac22786d95a253f03de0148be4fe3201 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 28 Jun 2020 18:26:20 +0300 Subject: [PATCH] MS-Windows fixes as followup to import of Gnulib 'getrandom' * nt/mingw-cfg.site (gl_cv_lib_assume_bcrypt): Set to "no" to disable linking against bcrypt.dll. (Bug#42095) * src/gnutls.c (gnutls_rnd) [WINDOWSNT]: Don't define a function pointer, and don't load it from GnuTLS DLL. (w32_gnutls_rnd) [WINDOWSNT]: Delete unused function. * src/fns.c (gnutls_rnd) [WINDOWSNT]: Don't redirect to w32_gnutls_rnd. --- nt/mingw-cfg.site | 3 +++ src/fns.c | 4 ---- src/gnutls.c | 11 ----------- 3 files changed, 3 insertions(+), 15 deletions(-) diff --git a/nt/mingw-cfg.site b/nt/mingw-cfg.site index 2e898c745e5..4a77cc20b4e 100644 --- a/nt/mingw-cfg.site +++ b/nt/mingw-cfg.site @@ -153,3 +153,6 @@ gl_cv_warn_c__Wredundant_decls=no # missing prototype, since lib/unistd.h, where Gnulib has its # prototype, isn't built on Windows. gl_cv_func_copy_file_range=yes +# We don't want to build Emacs so it depends on bcrypt.dll, since then +# it will refuse to start on systems where that DLL is absent. +gl_cv_lib_assume_bcrypt=no diff --git a/src/fns.c b/src/fns.c index c1465f7fe3c..a95a4b6e678 100644 --- a/src/fns.c +++ b/src/fns.c @@ -39,10 +39,6 @@ along with GNU Emacs. If not, see . */ #include "puresize.h" #include "gnutls.h" -#if defined WINDOWSNT && defined HAVE_GNUTLS3 -# define gnutls_rnd w32_gnutls_rnd -#endif - static void sort_vector_copy (Lisp_Object, ptrdiff_t, Lisp_Object *restrict, Lisp_Object *restrict); enum equal_kind { EQUAL_NO_QUIT, EQUAL_PLAIN, EQUAL_INCLUDING_PROPERTIES }; diff --git a/src/gnutls.c b/src/gnutls.c index 70176c41cdd..416fb154701 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -230,7 +230,6 @@ DEF_DLL_FN (const char *, gnutls_compression_get_name, DEF_DLL_FN (unsigned, gnutls_safe_renegotiation_status, (gnutls_session_t)); # ifdef HAVE_GNUTLS3 -DEF_DLL_FN (int, gnutls_rnd, (gnutls_rnd_level_t, void *, size_t)); DEF_DLL_FN (const gnutls_mac_algorithm_t *, gnutls_mac_list, (void)); # ifdef HAVE_GNUTLS_MAC_GET_NONCE_SIZE DEF_DLL_FN (size_t, gnutls_mac_get_nonce_size, (gnutls_mac_algorithm_t)); @@ -381,7 +380,6 @@ init_gnutls_functions (void) # endif LOAD_DLL_FN (library, gnutls_safe_renegotiation_status); # ifdef HAVE_GNUTLS3 - LOAD_DLL_FN (library, gnutls_rnd); LOAD_DLL_FN (library, gnutls_mac_list); # ifdef HAVE_GNUTLS_MAC_GET_NONCE_SIZE LOAD_DLL_FN (library, gnutls_mac_get_nonce_size); @@ -519,7 +517,6 @@ init_gnutls_functions (void) # define gnutls_x509_crt_import fn_gnutls_x509_crt_import # define gnutls_x509_crt_init fn_gnutls_x509_crt_init # ifdef HAVE_GNUTLS3 -# define gnutls_rnd fn_gnutls_rnd # define gnutls_mac_list fn_gnutls_mac_list # ifdef HAVE_GNUTLS_MAC_GET_NONCE_SIZE # define gnutls_mac_get_nonce_size fn_gnutls_mac_get_nonce_size @@ -573,14 +570,6 @@ init_gnutls_functions (void) # undef gnutls_free # define gnutls_free (*gnutls_free_func) -/* This wrapper is called from fns.c, which doesn't know about the - LOAD_DLL_FN stuff above. */ -int -w32_gnutls_rnd (gnutls_rnd_level_t level, void *data, size_t len) -{ - return gnutls_rnd (level, data, len); -} - # endif /* WINDOWSNT */ -- 2.39.5