From 71e0b6365481415c212bb81cf93acc3dac50781b Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 21 Feb 2020 19:29:02 -0800 Subject: modules/snow: use rand() on WIN32 My current version of mingw in debian 9.11 doesn't seem to have rand_r(), so let's just use plain rand() and lose the improved parallelization on win builds. --- src/modules/snow/snow.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/modules/snow/snow.c b/src/modules/snow/snow.c index af96285..d1f3758 100644 --- a/src/modules/snow/snow.c +++ b/src/modules/snow/snow.c @@ -64,7 +64,11 @@ static void snow_render_fragment(void *context, unsigned ticks, unsigned cpu, fb for (unsigned y = fragment->y; y < fragment->y + fragment->height; y++) { for (unsigned x = fragment->x; x < fragment->x + fragment->width; x++) { +#ifdef __WIN32__ + uint32_t pixel = rand(); +#else uint32_t pixel = rand_r(seed) % 256; +#endif fb_fragment_put_pixel_unchecked(fragment, x, y, pixel << 16 | pixel << 8 | pixel); } -- cgit v1.2.1