]> git.eshelyaron.com Git - emacs.git/commitdiff
MS-Windows fixes as followup to import of Gnulib 'getrandom'
authorEli Zaretskii <eliz@gnu.org>
Sun, 28 Jun 2020 15:26:20 +0000 (18:26 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sun, 28 Jun 2020 15:26:20 +0000 (18:26 +0300)
* 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
src/fns.c
src/gnutls.c

index 2e898c745e51392a4d528e9a72ff422f6cf17e75..4a77cc20b4ef519f7ae6cf7db6a87bc0664338bd 100644 (file)
@@ -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
index c1465f7fe3cf7e6607a3655dac702c9b33ef3a8e..a95a4b6e6782ff9e17d1b36cffc8154a0c2faee4 100644 (file)
--- a/src/fns.c
+++ b/src/fns.c
@@ -39,10 +39,6 @@ along with GNU Emacs.  If not, see <https://www.gnu.org/licenses/>.  */
 #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 };
index 70176c41cdde41a468512d915716a82f872ec337..416fb154701c2b23c5aca169996fd381bbe5f7f0 100644 (file)
@@ -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 */
 
 \f