diff --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp --- a/libcxx/src/random.cpp +++ b/libcxx/src/random.cpp @@ -13,6 +13,7 @@ #define _CRT_RAND_S #endif // defined(_LIBCPP_USING_WIN32_RANDOM) +#include "limits" #include "random" #include "system_error" @@ -33,7 +34,6 @@ #include #endif - _LIBCPP_BEGIN_NAMESPACE_STD #if defined(_LIBCPP_USING_GETENTROPY) @@ -172,7 +172,11 @@ double random_device::entropy() const _NOEXCEPT { +#ifdef __OpenBSD__ + return std::numeric_limits::digits; +#else return 0; +#endif } _LIBCPP_END_NAMESPACE_STD