1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-29 20:17:46 +00:00
serenity/Ports/fontconfig/patches/0001-Stub-out-FcRandom.patch

78 lines
1.7 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Brendan Coles <bcoles@gmail.com>
Date: Tue, 26 Oct 2021 11:34:34 +0000
Subject: [PATCH] Stub out FcRandom()
---
src/fccompat.c | 51 --------------------------------------------------
1 file changed, 51 deletions(-)
diff --git a/src/fccompat.c b/src/fccompat.c
index 65ac84c..96e4087 100644
--- a/src/fccompat.c
+++ b/src/fccompat.c
@@ -184,54 +184,6 @@ FcRandom(void)
{
int32_t result;
-#if HAVE_RANDOM_R
- static struct random_data fcrandbuf;
- static char statebuf[256];
- static FcBool initialized = FcFalse;
-#ifdef _AIX
- static char *retval;
- long res;
-#endif
-
- if (initialized != FcTrue)
- {
-#ifdef _AIX
- initstate_r (time (NULL), statebuf, 256, &retval, &fcrandbuf);
-#else
- initstate_r (time (NULL), statebuf, 256, &fcrandbuf);
-#endif
- initialized = FcTrue;
- }
-
-#ifdef _AIX
- random_r (&res, &fcrandbuf);
- result = (int32_t)res;
-#else
- random_r (&fcrandbuf, &result);
-#endif
-#elif HAVE_RANDOM
- static char statebuf[256];
- char *state;
- static FcBool initialized = FcFalse;
-
- if (initialized != FcTrue)
- {
- state = initstate (time (NULL), statebuf, 256);
- initialized = FcTrue;
- }
- else
- state = setstate (statebuf);
-
- result = random ();
-
- setstate (state);
-#elif HAVE_LRAND48
- result = lrand48 ();
-#elif HAVE_RAND_R
- static unsigned int seed = time (NULL);
-
- result = rand_r (&seed);
-#elif HAVE_RAND
static FcBool initialized = FcFalse;
if (initialized != FcTrue)
@@ -240,9 +192,6 @@ FcRandom(void)
initialized = FcTrue;
}
result = rand ();
-#else
-# error no random number generator function available.
-#endif
return result;
}