1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-09-11 11:50:52 +03:00

3 Commits

Author SHA1 Message Date
Bruno Haible
353a6ecc8b getrandom: Rename LIB_GETRANDOM to GETRANDOM_LIB.
* m4/getrandom.m4: Rename LIB_GETRANDOM to GETRANDOM_LIB.
All uses changed.
* NEWS: Mention the change.
2023-01-07 18:06:51 +01:00
Bruno Haible
8175e3ddda 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.
2020-05-31 18:23:04 +02:00
Bruno Haible
eaefb0474f getrandom: Add tests.
* tests/test-getrandom.c: New file.
* modules/getrandom-tests: New file.
2020-05-30 14:58:28 +02:00