mirror of
https://github.com/GerbilSoft/minizip-ng.git
synced 2025-06-18 19:45:36 -04:00
Removed arc4random_buf shim.
This commit is contained in:
parent
0574424b05
commit
6c6700d2f4
@ -21,9 +21,7 @@
|
||||
# include <unistd.h>
|
||||
# include <utime.h>
|
||||
#endif
|
||||
#if defined __APPLE__ && defined __MACH__
|
||||
# include <AvailabilityMacros.h>
|
||||
#elif defined __linux__
|
||||
#if defined __linux__
|
||||
# include <bsd/stdlib.h>
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
@ -36,22 +34,6 @@
|
||||
|
||||
/***************************************************************************/
|
||||
|
||||
#if defined __APPLE__ && defined __MACH__ && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_7
|
||||
static __inline__ int32_t arc4random_buf(uint8_t *buf, size_t nbytes)
|
||||
{
|
||||
for (; nbytes > 2; nbytes -= 3, buf += 3) {
|
||||
uint32_t val = arc4random();
|
||||
buf[0] = (val ) & 0xFF;
|
||||
buf[1] = (val >> 8) & 0xFF;
|
||||
buf[2] = (val >> 16) & 0xFF;
|
||||
}
|
||||
for (; nbytes > 0; nbytes--, buf++) {
|
||||
*buf = arc4random() & 0xFF;
|
||||
}
|
||||
return nbytes;
|
||||
}
|
||||
#endif
|
||||
|
||||
int32_t mz_posix_rand(uint8_t *buf, int32_t size)
|
||||
{
|
||||
arc4random_buf(buf, size);
|
||||
|
Loading…
Reference in New Issue
Block a user