From: Bruno Haible Date: Sat, 4 Jul 2020 02:00:01 +0000 (+0200) Subject: getrandom: Fix compilation error on native Windows (regression from 2020-06-28). X-Git-Tag: v1.0~3924 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=845d69187a4bbe26c1c1cc67735a0c3b01b1d2d2;p=gnulib.git getrandom: Fix compilation error on native Windows (regression from 2020-06-28). * lib/getrandom.c: Don't include . Instead, define NTSTATUS. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Include before . --- diff --git a/ChangeLog b/ChangeLog index 080f9e8342..59897eff6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2020-07-03 Bruno Haible + + getrandom: Fix compilation error on native Windows (regr. 2020-06-28). + * lib/getrandom.c: Don't include . Instead, define NTSTATUS. + * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Include before + . + 2020-07-03 Bruno Haible dfa tests: Follow common file naming conventions. diff --git a/lib/getrandom.c b/lib/getrandom.c index 030a78bb08..f8695abf30 100644 --- a/lib/getrandom.c +++ b/lib/getrandom.c @@ -32,7 +32,7 @@ # if HAVE_BCRYPT_H # include # else -# include /* NTSTATUS */ +# define NTSTATUS LONG typedef void * BCRYPT_ALG_HANDLE; # define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 # if HAVE_LIB_BCRYPT diff --git a/m4/getrandom.m4 b/m4/getrandom.m4 index 2a0034bf76..424c2fad3e 100644 --- a/m4/getrandom.m4 +++ b/m4/getrandom.m4 @@ -1,4 +1,4 @@ -# getrandom.m4 serial 6 +# getrandom.m4 serial 7 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,7 +36,9 @@ AC_DEFUN([gl_FUNC_GETRANDOM], case "$host_os" in mingw*) - AC_CHECK_HEADERS([bcrypt.h]) + AC_CHECK_HEADERS([bcrypt.h], [], [], + [[#include + ]]) AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present], [gl_cv_lib_assume_bcrypt], [AC_COMPILE_IFELSE(