summaryrefslogtreecommitdiff
path: root/dist/fontconfig
diff options
context:
space:
mode:
Diffstat (limited to 'dist/fontconfig')
-rw-r--r--dist/fontconfig/configure.ac2
-rw-r--r--dist/fontconfig/src/fccache.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/dist/fontconfig/configure.ac b/dist/fontconfig/configure.ac
index 06ac8a2e7..e1937c1b9 100644
--- a/dist/fontconfig/configure.ac
+++ b/dist/fontconfig/configure.ac
@@ -141,7 +141,7 @@ AC_TYPE_PID_T
# Checks for library functions.
AC_FUNC_VPRINTF
AC_FUNC_MMAP
-AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp mkostemp _mktemp_s strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
+AC_CHECK_FUNCS([geteuid getuid link memmove memset mkstemp mkostemp _mktemp_s strchr strrchr strtol getopt getopt_long sysconf ftruncate chsize arc4random rand random lrand48 random_r rand_r regcomp regerror regexec regfree fstatvfs fstatfs lstat])
dnl AC_CHECK_FUNCS doesn't check for header files.
dnl posix_fadvise() may be not available in older libc.
diff --git a/dist/fontconfig/src/fccache.c b/dist/fontconfig/src/fccache.c
index 610b8f0b7..1acaec6a9 100644
--- a/dist/fontconfig/src/fccache.c
+++ b/dist/fontconfig/src/fccache.c
@@ -258,7 +258,9 @@ FcRandom(void)
{
int32_t result;
-#if HAVE_RANDOM_R
+#if HAVE_ARC4RANDOM
+ result = arc4random() & 0x7fffffff;
+#elif HAVE_RANDOM_R
static struct random_data fcrandbuf;
static char statebuf[256];
static FcBool initialized = FcFalse;