2014-11-19 07:43:07 -06:00
|
|
|
/*
|
|
|
|
* stdlib.h compatibility shim
|
|
|
|
* Public domain
|
|
|
|
*/
|
|
|
|
|
2014-07-10 22:06:10 -05:00
|
|
|
#ifdef _MSC_VER
|
2015-09-08 15:00:09 -05:00
|
|
|
#if _MSC_VER >= 1900
|
|
|
|
#include <../ucrt/stdlib.h>
|
|
|
|
#else
|
2014-07-10 22:06:10 -05:00
|
|
|
#include <../include/stdlib.h>
|
2015-09-08 15:00:09 -05:00
|
|
|
#endif
|
2014-07-10 22:06:10 -05:00
|
|
|
#else
|
|
|
|
#include_next <stdlib.h>
|
|
|
|
#endif
|
|
|
|
|
2015-07-21 12:04:07 -06:00
|
|
|
#ifndef LIBCRYPTOCOMPAT_STDLIB_H
|
|
|
|
#define LIBCRYPTOCOMPAT_STDLIB_H
|
|
|
|
|
2014-07-10 22:06:10 -05:00
|
|
|
#include <sys/types.h>
|
2014-07-10 06:21:51 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2014-10-29 15:44:36 -05:00
|
|
|
#ifndef HAVE_ARC4RANDOM_BUF
|
2014-07-10 06:21:51 -05:00
|
|
|
uint32_t arc4random(void);
|
|
|
|
void arc4random_buf(void *_buf, size_t n);
|
2015-12-06 23:32:18 -06:00
|
|
|
uint32_t arc4random_uniform(uint32_t upper_bound);
|
2014-07-28 12:09:38 -05:00
|
|
|
#endif
|
|
|
|
|
2014-10-29 15:44:36 -05:00
|
|
|
#ifndef HAVE_REALLOCARRAY
|
2014-07-10 06:21:51 -05:00
|
|
|
void *reallocarray(void *, size_t, size_t);
|
2014-07-28 12:09:38 -05:00
|
|
|
#endif
|
|
|
|
|
2014-10-29 15:44:36 -05:00
|
|
|
#ifndef HAVE_STRTONUM
|
2014-07-10 06:21:51 -05:00
|
|
|
long long strtonum(const char *nptr, long long minval,
|
|
|
|
long long maxval, const char **errstr);
|
2014-07-28 12:09:38 -05:00
|
|
|
#endif
|
2014-07-10 06:21:51 -05:00
|
|
|
|
|
|
|
#endif
|