diff --git a/ChangeLog.d/arc4random_buf-implicit.txt b/ChangeLog.d/arc4random_buf-implicit.txt new file mode 100644 index 000000000..81c245e67 --- /dev/null +++ b/ChangeLog.d/arc4random_buf-implicit.txt @@ -0,0 +1,3 @@ +Bugfix + * Make arc4random_buf available on NetBSD and OpenBSD when _POSIX_C_SOURCE is + defined. Fix contributed in #3571. diff --git a/tests/src/random.c b/tests/src/random.c index 3345f78be..78419c4d4 100644 --- a/tests/src/random.c +++ b/tests/src/random.c @@ -24,6 +24,15 @@ * This file is part of mbed TLS (https://tls.mbed.org) */ +/* + * for arc4random_buf() from + */ +#if defined(__NetBSD__) +#define _NETBSD_SOURCE 1 +#elif defined(__OpenBSD__) +#define _BSD_SOURCE 1 +#endif + #include #include #include