diff options
| author | Paul Eggert | 2020-06-28 13:22:44 -0700 |
|---|---|---|
| committer | Paul Eggert | 2020-06-28 13:24:06 -0700 |
| commit | 665014452dec841302785bcd0fc4dc96d93f3d30 (patch) | |
| tree | 2fb65ad54fd18d9e9c5e717dc2ef03f0ad024c7a /lib/getrandom.c | |
| parent | 162f375bac22786d95a253f03de0148be4fe3201 (diff) | |
| download | emacs-665014452dec841302785bcd0fc4dc96d93f3d30.tar.gz emacs-665014452dec841302785bcd0fc4dc96d93f3d30.zip | |
Update from Gnulib.
This incorporates:
2020-06-28 getrandom: do not depend on ‘open’ on mingw
2020-06-28 getrandom: fix compilation errors on older versions of mingw
* build-aux/config.sub, lib/getrandom.c, m4/getrandom.m4:
Copy from Gnulib
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
Diffstat (limited to 'lib/getrandom.c')
| -rw-r--r-- | lib/getrandom.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/getrandom.c b/lib/getrandom.c index f0b3f535007..030a78bb08d 100644 --- a/lib/getrandom.c +++ b/lib/getrandom.c | |||
| @@ -29,7 +29,16 @@ | |||
| 29 | #if defined _WIN32 && ! defined __CYGWIN__ | 29 | #if defined _WIN32 && ! defined __CYGWIN__ |
| 30 | # define WIN32_LEAN_AND_MEAN | 30 | # define WIN32_LEAN_AND_MEAN |
| 31 | # include <windows.h> | 31 | # include <windows.h> |
| 32 | # include <bcrypt.h> | 32 | # if HAVE_BCRYPT_H |
| 33 | # include <bcrypt.h> | ||
| 34 | # else | ||
| 35 | # include <ntdef.h> /* NTSTATUS */ | ||
| 36 | typedef void * BCRYPT_ALG_HANDLE; | ||
| 37 | # define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 | ||
| 38 | # if HAVE_LIB_BCRYPT | ||
| 39 | extern NTSTATUS WINAPI BCryptGenRandom (BCRYPT_ALG_HANDLE, UCHAR *, ULONG, ULONG); | ||
| 40 | # endif | ||
| 41 | # endif | ||
| 33 | # if !HAVE_LIB_BCRYPT | 42 | # if !HAVE_LIB_BCRYPT |
| 34 | # include <wincrypt.h> | 43 | # include <wincrypt.h> |
| 35 | # ifndef CRYPT_VERIFY_CONTEXT | 44 | # ifndef CRYPT_VERIFY_CONTEXT |