aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-10-13 08:57:35 +0100
committerMarge Bot <[email protected]>2020-05-16 12:05:37 +0000
commitfa3549c92b240aab23bd5838f1fdca2ae4caf055 (patch)
tree8f69f811acd46e016e13765883013b2f60757a11 /src
parentd76abe98cf15226f25d93e76e383715061ada6f4 (diff)
util/rand_xor: extend the urandom path to all non-Windows platforms
Any system that provides `/dev/urandom` should be allowed to try to use it. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Emmanuel Gil Peyrot <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2316>
Diffstat (limited to 'src')
-rw-r--r--src/util/rand_xor.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/util/rand_xor.c b/src/util/rand_xor.c
index 3668ac9b84a..81b64f1ea71 100644
--- a/src/util/rand_xor.c
+++ b/src/util/rand_xor.c
@@ -22,7 +22,9 @@
*
*/
-#if defined(__linux__)
+#include "detect_os.h"
+
+#if !DETECT_OS_WINDOWS
#if defined(HAVE_GETRANDOM)
#include <sys/random.h>
#endif
@@ -63,7 +65,7 @@ s_rand_xorshift128plus(uint64_t seed[2], bool randomised_seed)
return;
}
-#if defined(__linux__)
+#if !DETECT_OS_WINDOWS
size_t seed_size = sizeof(uint64_t) * 2;
#if defined(HAVE_GETRANDOM)