Fix build on non GLIBC platforms (FreeBSD at least)
authorRobert Noland <rnoland@2hip.net>
Tue, 22 Sep 2009 18:49:57 +0000 (11:49 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 28 Sep 2009 15:48:45 +0000 (09:48 -0600)
Build was broken by commit 9666529b5a5be1fcde82caadc2fe2efa5ea81e49

I'm not certain that this is entirely the correct fix since the demo
from bug #23774 seemed to work before the commit that broke the build.

Signed-off-by: Robert Noland <rnoland@2hip.net>
Signed-off-by: Brian Paul <brianp@vmware.com>
src/glx/x11/glxhash.c

index 6f2c51d39dd984e634af8782c93692372bd43aad..b76ec32345940c3020e0f5045d223f171e17e048 100644 (file)
 
 #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 {                                                                \
    } while(0)
 #define HASH_RANDOM             ((void) random_r(&rd, &rv), rv)
 #define HASH_RANDOM_DESTROY
+#endif
 
 typedef struct __glxHashBucket
 {