diff options
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 |