tools: use rand() as fallback of random().
authorJehan <jehan@girinstud.io>
Mon, 24 Jan 2022 14:11:34 +0000 (15:11 +0100)
committerJehan <jehan@girinstud.io>
Mon, 24 Jan 2022 14:21:05 +0000 (15:21 +0100)
This fixes building babl on Windows as the random() API is not available
there (unlike rand()). Windows docs says it's not cryptographically
secure but for this tool usage, it's probably enough and I see we use
the same function replacement tricks on other tool sources.

tools/babl-lut-verify.c

index e23ed3d8f0330c4c4d6d42595666716d974104c9..5f796825255cb60ca4e4f4a35b6a94446e851ca1 100644 (file)
@@ -6,6 +6,9 @@
 
 #define PIXELS 127*256 //less than threshold for generating
 
+#ifndef HAVE_SRANDOM
+#define random rand
+#endif
 
 static double
 test_u8_premul (void)