summaryrefslogtreecommitdiff
path: root/random
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2021-02-12 15:21:00 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2021-02-12 15:21:00 +0900
commitd78cdf42854b17e2216890e7b78f9e7e05c0b1f8 (patch)
treeed29750f9b872fc3e997b3aba591f9df17810f1e /random
parent82395f11b444651f544f5e51c62fc6b65c04f9ef (diff)
downloadlibgcrypt-d78cdf42854b17e2216890e7b78f9e7e05c0b1f8.tar.gz
random: Fix build for macOS.
* random/rndlinux.c [__APPLE__] (HAVE_GETENTROPY): Valid only when the macro __MAC_10_11 is available. -- GnuPG-bug-id: 5268 Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'random')
-rw-r--r--random/rndlinux.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/random/rndlinux.c b/random/rndlinux.c
index a22db177..a7a78906 100644
--- a/random/rndlinux.c
+++ b/random/rndlinux.c
@@ -33,9 +33,12 @@
#include <unistd.h>
#include <fcntl.h>
#if defined(__APPLE__) && defined(__MACH__)
+#include <Availability.h>
+#ifdef __MAC_10_11
extern int getentropy (void *buf, size_t buflen) __attribute__ ((weak_import));
#define HAVE_GETENTROPY
#endif
+#endif
#if defined(__linux__) || !defined(HAVE_GETENTROPY)
#ifdef HAVE_SYSCALL
# include <sys/syscall.h>