Mesa (master): util/rand_xor: extend the urandom path to all non-Windows platforms
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat May 16 12:25:18 UTC 2020
Module: Mesa
Branch: master
Commit: fa3549c92b240aab23bd5838f1fdca2ae4caf055
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa3549c92b240aab23bd5838f1fdca2ae4caf055
Author: Eric Engestrom <eric.engestrom at intel.com>
Date: Sun Oct 13 08:57:35 2019 +0100
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 <eric.engestrom at intel.com>
Reviewed-by: Emmanuel Gil Peyrot <linkmauve at linkmauve.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2316>
---
src/util/rand_xor.c | 6 ++++--
1 file 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)
More information about the mesa-commit
mailing list