diff options
author | Bruno Haible <bruno@clisp.org> | 2020-06-28 19:04:03 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-06-28 19:04:03 +0200 |
commit | 70872213ef6614cf52d5978a5fdf8b9e628fc786 (patch) | |
tree | bf3f6360d542ec1b345851d3503aa696060b5a41 /m4/getrandom.m4 | |
parent | e6856168aaa96cbda1c01add379831eca98130c0 (diff) | |
download | gnulib-70872213ef6614cf52d5978a5fdf8b9e628fc786.tar.gz |
getrandom: Fix compilation errors on older versions of mingw.
Reported by Eli Zaretskii <eliz@gnu.org> in
<https://lists.gnu.org/archive/html/bug-gnulib/2020-06/msg00059.html>.
* m4/getrandom.m4 (gl_FUNC_GETRANDOM): Test whether <bcrypt.h> exists.
* lib/getrandom.c: If <bcrypt.h> is not available, include <ntdef.h> and
define/declare BCRYPT_ALG_HANDLE, BCRYPT_USE_SYSTEM_PREFERRED_RNG,
BCryptGenRandom ourselves.
Diffstat (limited to 'm4/getrandom.m4')
-rw-r--r-- | m4/getrandom.m4 | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/m4/getrandom.m4 b/m4/getrandom.m4 index 37fb10023a..2a0034bf76 100644 --- a/m4/getrandom.m4 +++ b/m4/getrandom.m4 @@ -1,4 +1,4 @@ -# getrandom.m4 serial 5 +# getrandom.m4 serial 6 dnl Copyright 2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -36,6 +36,7 @@ AC_DEFUN([gl_FUNC_GETRANDOM], case "$host_os" in mingw*) + AC_CHECK_HEADERS([bcrypt.h]) AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present], [gl_cv_lib_assume_bcrypt], [AC_COMPILE_IFELSE( |