Merge pull request #3602 from gufe44/arc4random_buf-implicit-2.16

[Backport 2.16] NetBSD/OpenBSD symbol availability fix
This commit is contained in:
Gilles Peskine 2020-11-12 12:12:45 +01:00 committed by GitHub
commit a3e57531d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View file

@ -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.

View file

@ -23,6 +23,15 @@
#endif
#endif
/*
* for arc4random_buf() from <stdlib.h>
*/
#if defined(__NetBSD__)
#define _NETBSD_SOURCE 1
#elif defined(__OpenBSD__)
#define _BSD_SOURCE 1
#endif
#if !defined(MBEDTLS_CONFIG_FILE)
#include <mbedtls/config.h>
#else