From 87d7936d403ee8c6630d552333cd9bc9e9b77f37 Mon Sep 17 00:00:00 2001 From: gufe44 Date: Mon, 17 Aug 2020 15:04:06 +0200 Subject: [PATCH] Make arc4random_buf declaration available on NetBSD Signed-off-by: gufe44 --- ChangeLog.d/arc4random_buf-implicit.txt | 3 +++ tests/suites/main_test.function | 9 +++++++++ 2 files changed, 12 insertions(+) create mode 100644 ChangeLog.d/arc4random_buf-implicit.txt diff --git a/ChangeLog.d/arc4random_buf-implicit.txt b/ChangeLog.d/arc4random_buf-implicit.txt new file mode 100644 index 000000000..d20e4c848 --- /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. Adopted for LTS branch 2.16 in #3602. diff --git a/tests/suites/main_test.function b/tests/suites/main_test.function index 8944fd912..27010780f 100644 --- a/tests/suites/main_test.function +++ b/tests/suites/main_test.function @@ -25,6 +25,15 @@ #endif #endif +/* + * for arc4random_buf() from + */ +#if defined(__NetBSD__) +#define _NETBSD_SOURCE 1 +#elif defined(__OpenBSD__) +#define _BSD_SOURCE 1 +#endif + #if !defined(MBEDTLS_CONFIG_FILE) #include #else