diff options
Diffstat (limited to 'include/compat/stdlib.h')
-rw-r--r-- | include/compat/stdlib.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/include/compat/stdlib.h b/include/compat/stdlib.h new file mode 100644 index 0000000..47189fd --- /dev/null +++ b/include/compat/stdlib.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * stdlib.h compatibility shim | ||
3 | * Public domain | ||
4 | */ | ||
5 | |||
6 | #ifndef LIBCRYPTOCOMPAT_STDLIB_H | ||
7 | #define LIBCRYPTOCOMPAT_STDLIB_H | ||
8 | |||
9 | #ifdef _MSC_VER | ||
10 | #include <../include/stdlib.h> | ||
11 | #else | ||
12 | #include_next <stdlib.h> | ||
13 | #endif | ||
14 | |||
15 | #include <sys/types.h> | ||
16 | #include <sys/stat.h> | ||
17 | //#include <sys/time.h> | ||
18 | #include <stdint.h> | ||
19 | |||
20 | #ifndef HAVE_ARC4RANDOM_BUF | ||
21 | uint32_t arc4random(void); | ||
22 | void arc4random_buf(void *_buf, size_t n); | ||
23 | #endif | ||
24 | |||
25 | #ifndef HAVE_REALLOCARRAY | ||
26 | void *reallocarray(void *, size_t, size_t); | ||
27 | #endif | ||
28 | |||
29 | #ifndef HAVE_STRTONUM | ||
30 | long long strtonum(const char *nptr, long long minval, | ||
31 | long long maxval, const char **errstr); | ||
32 | #endif | ||
33 | |||
34 | #endif | ||