util/rand_xor: extend the urandom path to all non-Windows platforms
authorEric Engestrom <eric.engestrom@intel.com>
Sun, 13 Oct 2019 07:57:35 +0000 (08:57 +0100)
committerMarge Bot <eric+marge@anholt.net>
Sat, 16 May 2020 12:05:37 +0000 (12:05 +0000)
Any system that provides `/dev/urandom` should be allowed to try to use it.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/2316>

src/util/rand_xor.c

index 3668ac9b84a0309aec837642b71873cb3be687d1..81b64f1ea71712a49338e5b77bf9ae166413e671 100644 (file)
@@ -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)