summaryrefslogtreecommitdiff
path: root/src/glx/x11/glxhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glx/x11/glxhash.c')
-rw-r--r--src/glx/x11/glxhash.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/glx/x11/glxhash.c b/src/glx/x11/glxhash.c
index 7d28ada49c..b76ec32345 100644
--- a/src/glx/x11/glxhash.c
+++ b/src/glx/x11/glxhash.c
@@ -77,6 +77,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#define HASH_MAGIC 0xdeadbeef
#define HASH_DEBUG 0
@@ -87,6 +88,12 @@
#define HASH_ALLOC malloc
#define HASH_FREE free
+#ifndef __GLIBC__
+#define HASH_RANDOM_DECL char *ps, rs[256]
+#define HASH_RANDOM_INIT(seed) ps = initstate(seed, rs, sizeof(rs))
+#define HASH_RANDOM random()
+#define HASH_RANDOM_DESTROY setstate(ps)
+#else
#define HASH_RANDOM_DECL struct random_data rd; int32_t rv; char rs[256]
#define HASH_RANDOM_INIT(seed) \
do { \
@@ -95,6 +102,7 @@
} while(0)
#define HASH_RANDOM ((void) random_r(&rd, &rv), rv)
#define HASH_RANDOM_DESTROY
+#endif
typedef struct __glxHashBucket
{