[babl] tools: use rand() as fallback of random().



commit 1f1ce31cfe8650c497d11d8b17614ae9da01b637
Author: Jehan <jehan girinstud io>
Date:   Mon Jan 24 15:11:34 2022 +0100

    tools: use rand() as fallback of random().
    
    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 | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/tools/babl-lut-verify.c b/tools/babl-lut-verify.c
index e23ed3d8f..5f7968252 100644
--- a/tools/babl-lut-verify.c
+++ b/tools/babl-lut-verify.c
@@ -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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]