From 8175e3ddda29a03d5e0aec4a1774339414996565 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 31 May 2020 18:23:04 +0200 Subject: getrandom: Add support for native Windows. * lib/getrandom.c: Include , , , . (CRYPT_VERIFY_CONTEXT): New macro. (LoadLibrary, CryptAcquireContext): Redirect to the variant with suffix 'A'. (GetProcAddress): New macro. (BCryptGenRandomFuncType): New type. (BCryptGenRandomFunc, initialized): New variables. (initialize): New function. (getrandom): On native Windows, use API when available, and API as fallback. * m4/getrandom.m4 (gl_FUNC_GETRANDOM): Set LIB_GETRANDOM. * modules/getrandom (Link): New section. * modules/getentropy (Link): Likewise. * modules/getrandom-tests (Makefile.am): Link test-getrandom against $(LIB_GETRANDOM). * modules/getentropy-tests (Makefile.am): Link test-getentropy against $(LIB_GETRANDOM). * modules/sys_random-c++-tests (Makefile.am): Link test-sys_random-c++ against $(LIB_GETRANDOM). * doc/glibc-functions/getrandom.texi: Mention the native Windows support. --- modules/getentropy-tests | 1 + 1 file changed, 1 insertion(+) (limited to 'modules/getentropy-tests') diff --git a/modules/getentropy-tests b/modules/getentropy-tests index b5c4b1144e..7ad786109c 100644 --- a/modules/getentropy-tests +++ b/modules/getentropy-tests @@ -10,3 +10,4 @@ configure.ac: Makefile.am: TESTS += test-getentropy check_PROGRAMS += test-getentropy +test_getentropy_LDADD = $(LDADD) $(LIB_GETRANDOM) -- cgit v1.2.1