summaryrefslogtreecommitdiff
path: root/boost/uuid
diff options
context:
space:
mode:
Diffstat (limited to 'boost/uuid')
-rw-r--r--boost/uuid/detail/random_provider_detect_platform.hpp11
-rw-r--r--boost/uuid/detail/sha1.hpp2
-rw-r--r--boost/uuid/entropy_error.hpp5
3 files changed, 11 insertions, 7 deletions
diff --git a/boost/uuid/detail/random_provider_detect_platform.hpp b/boost/uuid/detail/random_provider_detect_platform.hpp
index f24b06f379..b3b2655587 100644
--- a/boost/uuid/detail/random_provider_detect_platform.hpp
+++ b/boost/uuid/detail/random_provider_detect_platform.hpp
@@ -14,10 +14,15 @@
#include <boost/predef/library/c/cloudabi.h>
#include <boost/predef/library/c/gnu.h>
#include <boost/predef/os/bsd/open.h>
-#include <boost/predef/os/linux.h>
#include <boost/predef/os/windows.h>
-#if BOOST_OS_LINUX
+
+// Note: Don't use Boost.Predef to detect Linux and Android as it may give different results depending on header inclusion order.
+// https://github.com/boostorg/predef/issues/81#issuecomment-413329061
+#if (defined(__linux__) || defined(__linux) || defined(linux)) && (!defined(__ANDROID__) || __ANDROID_API__ >= 28)
#include <sys/syscall.h>
+#if defined(SYS_getrandom)
+#define BOOST_UUID_RANDOM_PROVIDER_HAS_GETRANDOM
+#endif // defined(SYS_getrandom)
#endif
//
@@ -45,7 +50,7 @@
# error Unable to find a suitable windows entropy provider
# endif
-#elif BOOST_OS_LINUX && defined(SYS_getrandom) && !defined(BOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX) && !defined(BOOST_UUID_RANDOM_PROVIDER_DISABLE_GETRANDOM)
+#elif defined(BOOST_UUID_RANDOM_PROVIDER_HAS_GETRANDOM) && !defined(BOOST_UUID_RANDOM_PROVIDER_FORCE_POSIX) && !defined(BOOST_UUID_RANDOM_PROVIDER_DISABLE_GETRANDOM)
# define BOOST_UUID_RANDOM_PROVIDER_GETRANDOM
# define BOOST_UUID_RANDOM_PROVIDER_NAME getrandom
diff --git a/boost/uuid/detail/sha1.hpp b/boost/uuid/detail/sha1.hpp
index 7831e571bc..871a3199d6 100644
--- a/boost/uuid/detail/sha1.hpp
+++ b/boost/uuid/detail/sha1.hpp
@@ -1,5 +1,3 @@
-// boost/uuid/sha1.hpp header file ----------------------------------------------//
-
// Copyright 2007 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
diff --git a/boost/uuid/entropy_error.hpp b/boost/uuid/entropy_error.hpp
index 27f2936e5e..e7a48b88b9 100644
--- a/boost/uuid/entropy_error.hpp
+++ b/boost/uuid/entropy_error.hpp
@@ -1,5 +1,5 @@
//
-// Copyright (c) 2017 James E. King III
+// Copyright (c) 2017, 2018 James E. King III
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@@ -11,6 +11,7 @@
#ifndef BOOST_UUID_RANDOM_ENTROPY_ERROR_HPP
#define BOOST_UUID_RANDOM_ENTROPY_ERROR_HPP
+#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <stdexcept>
#include <string>
@@ -21,7 +22,7 @@ namespace uuids {
//! \brief Given boost::system::system_error is in a module that
//! is not header-only, we define our own exception type
//! to handle entropy provider errors instead,
-class entropy_error : public std::runtime_error
+class BOOST_SYMBOL_VISIBLE entropy_error : public std::runtime_error
{
public:
entropy_error(boost::intmax_t errCode, const std::string& message)