2
0
mirror of https://git.sr.ht/~sircmpwn/mkproof synced 2024-12-03 23:18:13 +01:00
mkproof/include/random.h
William Casarin 4a8e70d38c Fix build on macos
I'm not sure entirely sure why arc4random_buf needs to be forward
declared, but these changes are needed for macos builds to work.

Fixed build errors:

include/random.h:4:1: error: unknown type name 'ssize_t'; did you mean 'size_t'?
ssize_t get_random_bytes(unsigned char *buf, size_t nbytes);
^~~~~~~

src/random-arc4.c:7:2: error: implicit declaration of function 'arc4random_buf'
is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        arc4random_buf(buf, nbytes);

Signed-off-by: William Casarin <jb55@jb55.com>
2020-12-24 14:22:11 -05:00

9 lines
128 B
C

#ifndef RANDOM_H
#define RANDOM_H
#include <sys/types.h>
ssize_t get_random_bytes(unsigned char *buf, size_t nbytes);
#endif