summaryrefslogtreecommitdiff
path: root/modules/getentropy-tests
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-05-31 18:23:04 +0200
committerBruno Haible <bruno@clisp.org>2020-05-31 18:23:04 +0200
commit8175e3ddda29a03d5e0aec4a1774339414996565 (patch)
tree6dda6c4f9711a1f925e9929277a42b41c62ce8fd /modules/getentropy-tests
parent053dd57da26bcda9f03180758fce81fffe7747c8 (diff)
downloadgnulib-8175e3ddda29a03d5e0aec4a1774339414996565.tar.gz
getrandom: Add support for native Windows.
* lib/getrandom.c: Include <errno.h>, <windows.h>, <bcrypt.h>, <wincrypt.h>. (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 <bcrypt.h> API when available, and <wincrypt.h> 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.
Diffstat (limited to 'modules/getentropy-tests')
-rw-r--r--modules/getentropy-tests1
1 files changed, 1 insertions, 0 deletions
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)