Small code refactoring.
This commit is contained in:
parent
1d914cc031
commit
f4650438d7
@ -29,11 +29,9 @@
|
|||||||
#define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0U]))
|
#define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0U]))
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
unsigned char __stdcall SystemFunction036(void *buffer, unsigned long length);
|
#define RtlGenRandom SystemFunction036
|
||||||
static int getentropy(void* const buffer, const size_t length)
|
#define getentropy(X,Y) (RtlGenRandom((X),(uint32_t)(Y)) ? 0 : (-1))
|
||||||
{
|
unsigned char __stdcall RtlGenRandom(void *buffer, uint32_t length);
|
||||||
return SystemFunction036(buffer, (unsigned long)length) ? 0 : (-1);
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static INLINE uint64_t random_uint64(void)
|
static INLINE uint64_t random_uint64(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user