mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-07 06:04:59 +00:00
Merge pull request #356 from wxWidgets/mingw-rand_s-decl
Declare rand_s() for MinGW 32 ourselves
This commit is contained in:
commit
2e013217d4
1 changed files with 7 additions and 0 deletions
|
@ -736,6 +736,13 @@ writeRandomBytes_arc4random(void *target, size_t count) {
|
|||
|
||||
#ifdef _WIN32
|
||||
|
||||
/* Provide declaration of rand_s() for MinGW-32 (not 64, which has it),
|
||||
as it doesn't declare it in its header up to at least 5.2.2 version
|
||||
of its runtime package (mingwrt, containing stdlib.h). */
|
||||
# if defined(__MINGW32__) && ! defined(__MINGW64_VERSION_MAJOR)
|
||||
__declspec(dllimport) int rand_s(unsigned int *);
|
||||
# endif
|
||||
|
||||
/* Obtain entropy on Windows using the rand_s() function which
|
||||
* generates cryptographically secure random numbers. Internally it
|
||||
* uses RtlGenRandom API which is present in Windows XP and later.
|
||||
|
|
Loading…
Add table
Reference in a new issue