[babl] tools: Use rand when random is unavailable
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] tools: Use rand when random is unavailable
- Date: Wed, 23 Aug 2017 22:39:54 +0000 (UTC)
commit 00f4a0b36ee203038e649ab7b3fdb3fe1468b9ce
Author: Edward E <develinthedetail gmail com>
Date: Tue Aug 22 16:31:56 2017 -0500
tools: Use rand when random is unavailable
borrowed from c1f075f22c70de54c2b04ca5df008a5e406d3ca9
tools/babl-benchmark.c | 5 +++++
tools/babl-gen-test-pixels.c | 5 +++++
2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/tools/babl-benchmark.c b/tools/babl-benchmark.c
index 3ed3539..fa964f9 100644
--- a/tools/babl-benchmark.c
+++ b/tools/babl-benchmark.c
@@ -20,6 +20,11 @@
#include <math.h>
#include "babl-internal.h"
+#ifndef HAVE_SRANDOM
+#define srandom srand
+#define random rand
+#endif
+
int ITERATIONS = 2;
#define N_PIXELS (512*1024) // a too small batch makes the test set live
// in l2 cache skewing results
diff --git a/tools/babl-gen-test-pixels.c b/tools/babl-gen-test-pixels.c
index 59e3176..12b8040 100644
--- a/tools/babl-gen-test-pixels.c
+++ b/tools/babl-gen-test-pixels.c
@@ -20,6 +20,11 @@
#include <stdlib.h>
#include <stdio.h>
+#ifndef HAVE_SRANDOM
+#define srandom srand
+#define random rand
+#endif
+
#define BABL_PATH_NUM_TEST_PIXELS 3072
#define BABL_CONVERSION_NUM_TEST_PIXELS 128
#define BABL_FROMAT_NUM_TEST_PIXELS 256
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]