aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-03-09 17:48:31 -0500
committerJack Lloyd <[email protected]>2018-03-09 17:48:31 -0500
commitacecc97cbe1feead8c437b2fd49b80065d7cbe41 (patch)
treeacc6fa8b1fe9407ca9723734b1e52e01f140b83e /src
parent3ecffa3916ec6a0c72a0b2eaa580de05eb4474f7 (diff)
Fix header for getentropy on macOS
Re #1481
Diffstat (limited to 'src')
-rw-r--r--src/lib/entropy/getentropy/getentropy.cpp6
-rwxr-xr-xsrc/scripts/ci_build.py2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/entropy/getentropy/getentropy.cpp b/src/lib/entropy/getentropy/getentropy.cpp
index e578a4ed5..15bd8abe8 100644
--- a/src/lib/entropy/getentropy/getentropy.cpp
+++ b/src/lib/entropy/getentropy/getentropy.cpp
@@ -7,7 +7,11 @@
#include <botan/internal/getentropy.h>
-#include <unistd.h>
+#if defined(BOTAN_TARGET_OS_IS_DARWIN)
+ #include <sys/random.h>
+#else
+ #include <unistd.h>
+#endif
namespace Botan {
diff --git a/src/scripts/ci_build.py b/src/scripts/ci_build.py
index dfb65d629..5560ced51 100755
--- a/src/scripts/ci_build.py
+++ b/src/scripts/ci_build.py
@@ -170,6 +170,8 @@ def determine_flags(target, target_os, target_cpu, target_cc, cc_bin, ccache, ro
if target_os == 'osx':
# Test Boost on OS X
flags += ['--with-boost']
+ # Travis has 10.12 as default image
+ flags += ['--with-os-features=getentropy']
elif target_os == 'linux':
flags += ['--with-lzma']