summaryrefslogtreecommitdiff
path: root/src/glx/x11
diff options
context:
space:
mode:
authorNicolai Hähnle <nhaehnle@gmail.com>2009-09-20 16:59:03 +0200
committerNicolai Hähnle <nhaehnle@gmail.com>2009-09-20 16:59:03 +0200
commit82c2f7756af19f0a19aeda7ea1f627262e4561c0 (patch)
tree3bb57b29ce8a2ca23de50746dd4dff63e9f653c6 /src/glx/x11
parente617dd14ab4863921c02612ab76faa94b02a155c (diff)
parentc4ce6f6a7c124c62a8ee9bd9fba28fc69a38e18c (diff)
Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
Diffstat (limited to 'src/glx/x11')
-rw-r--r--src/glx/x11/glxhash.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/glx/x11/glxhash.c b/src/glx/x11/glxhash.c
index 74cd4f344d..7d28ada49c 100644
--- a/src/glx/x11/glxhash.c
+++ b/src/glx/x11/glxhash.c
@@ -87,9 +87,13 @@
#define HASH_ALLOC malloc
#define HASH_FREE free
-#define HASH_RANDOM_DECL
-#define HASH_RANDOM_INIT(seed) srandom(seed)
-#define HASH_RANDOM random()
+#define HASH_RANDOM_DECL struct random_data rd; int32_t rv; char rs[256]
+#define HASH_RANDOM_INIT(seed) \
+ do { \
+ (void) memset(&rd, 0, sizeof(rd)); \
+ (void) initstate_r(seed, rs, sizeof(rs), &rd); \
+ } while(0)
+#define HASH_RANDOM ((void) random_r(&rd, &rv), rv)
#define HASH_RANDOM_DESTROY
typedef struct __glxHashBucket