aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authortenzap <[email protected]>2021-11-16 18:08:33 +0100
committertenzap <[email protected]>2021-11-17 11:13:49 +0100
commit9748406270ded38f1673a4599c6fec9a7b8a9b67 (patch)
treed70a9d94421ffb099e8cde5d0798d3ed446ee48a /src/lib
parent7140a88c6db7e3ca10acbc11368017220dd63b00 (diff)
Fix compilation issue on older mac (< 10.12)
Error was: In file included from src/lib/entropy/getentropy/getentropy.cpp:13: /usr/include/sys/random.h:37:32: error: unknown type name 'u_int' void read_random(void* buffer, u_int numBytes); ^ /usr/include/sys/random.h:38:33: error: unknown type name 'u_int' void read_frandom(void* buffer, u_int numBytes); ^ /usr/include/sys/random.h:39:33: error: unknown type name 'u_int' int write_random(void* buffer, u_int numBytes); ^
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/entropy/getentropy/getentropy.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/entropy/getentropy/getentropy.cpp b/src/lib/entropy/getentropy/getentropy.cpp
index a1a6169b0..e255bbd52 100644
--- a/src/lib/entropy/getentropy/getentropy.cpp
+++ b/src/lib/entropy/getentropy/getentropy.cpp
@@ -10,6 +10,10 @@
#if defined(BOTAN_TARGET_OS_IS_OPENBSD) || defined(BOTAN_TARGET_OS_IS_FREEBSD) || defined(BOTAN_TARGET_OS_IS_SOLARIS)
#include <unistd.h>
#else
+ #if defined(BOTAN_TARGET_OS_HAS_POSIX1)
+ // Allows successful compilation on macOS older than 10.12: Provides a missing typedef for `u_int`.
+ #include <sys/types.h>
+ #endif
#include <sys/random.h>
#endif