# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
-AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand_r])
+AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand random lrand48])
#
# Checks for iconv
static FcCacheSkip *fcCacheChains[FC_CACHE_MAX_LEVEL];
static int fcCacheMaxLevel;
+#if HAVE_RANDOM
+# define FcRandom() random()
+#else
+# if HAVE_LRAND48
+# define FcRandom() lrand48()
+# else
+# if HAVE_RAND
+# define FcRandom() rand()
+# endif
+# endif
+#endif
/*
* Generate a random level number, distributed
* so that each level is 1/4 as likely as the one before
random_level (void)
{
/* tricky bit -- each bit is '1' 75% of the time */
- long int bits = random () | random ();
+ long int bits = FcRandom () | FcRandom ();
int level = 0;
while (++level < FC_CACHE_MAX_LEVEL)