diff --git a/include/pcp/platform.h b/include/pcp/platform.h index 2222816..5cc0a16 100755 --- a/include/pcp/platform.h +++ b/include/pcp/platform.h @@ -67,58 +67,51 @@ #ifndef HAVE_ARC4RANDOM -#include -u_int32_t arc4random(); + #include + #define arc4random() randombytes_random() #endif #ifndef HAVE_ARC4RANDOM_BUF -#include -void arc4random_buf(void *buf, size_t nbytes); + #include + #define arc4random_buf(buf, nbytes) randombytes((byte *)buf, nbytes) #endif #ifndef HAVE_ERR_H - -#include -#include -#include -#include - -void err(int eval, const char *fmt, ...); - + #include + #include + #include + #include + void err(int eval, const char *fmt, ...); #else - -#include -#include - + #include + #include #endif #ifndef HAVE_VASPRINTF - -#include -int vasprintf(char **ret, const char *format, va_list args); - + #include + int vasprintf(char **ret, const char *format, va_list args); #endif #ifdef _AIX_SOURCE -#define _LINUX_SOURCE_COMPAT + #define _LINUX_SOURCE_COMPAT #endif #ifndef HAVE_STRNLEN -size_t -strnlen(const char *msg, size_t maxlen); + size_t + strnlen(const char *msg, size_t maxlen); #endif #ifndef HAVE_STRNSTR -/* via FreeBSD libc */ -#include -char * -strnstr(const char *s, const char *find, size_t slen); + /* via FreeBSD libc */ + #include + char * + strnstr(const char *s, const char *find, size_t slen); #endif /* size_t format string */ diff --git a/libpcp/platform.c b/libpcp/platform.c index e3cb065..740ef3b 100644 --- a/libpcp/platform.c +++ b/libpcp/platform.c @@ -21,19 +21,6 @@ #include "platform.h" -#ifndef HAVE_ARC4RANDOM -u_int32_t arc4random() { - return randombytes_random(); -} -#endif - -#ifndef HAVE_ARC4RANDOM_BUF -#include -void arc4random_buf(void *buf, size_t nbytes) { - randombytes((unsigned char*)buf, nbytes); -} -#endif - #ifndef HAVE_ERR_H void err(int eval, const char *fmt, ...) { va_list ap;