From 85377e96d2403c74cf8a7c555168ce2f23d37849 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Thu, 21 Jan 2021 13:04:36 -0500 Subject: [PATCH] Fix undeclared identifier error in lightmapper_cpu.cpp Compiling with latest clang on macOS produced this error: use of undeclared identifier 'rand'. Fixes godotengine/godot#45342 This file is not present in 4.0/master. --- modules/lightmapper_cpu/lightmapper_cpu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/lightmapper_cpu/lightmapper_cpu.cpp b/modules/lightmapper_cpu/lightmapper_cpu.cpp index ba07451cdf7..9d7690261aa 100644 --- a/modules/lightmapper_cpu/lightmapper_cpu.cpp +++ b/modules/lightmapper_cpu/lightmapper_cpu.cpp @@ -777,7 +777,7 @@ void LightmapperCPU::_compute_direct_light(uint32_t p_idx, void *r_lightmap) { _ALWAYS_INLINE_ float uniform_rand() { /* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */ - static thread_local uint32_t state = rand(); + static thread_local uint32_t state = Math::rand(); state ^= state << 13; state ^= state >> 17; state ^= state << 5;