X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=src%2Ffccache.c;h=7e2c1bec9363068b2b2ec31fb743a4c00fdec348;hb=cc104e6a910427db009be36ec34125962889ecb8;hp=e289c5dd89bd3f8a400a21fb8edacfa0645d42d2;hpb=706a1b367abc4589c7eccfd7cea3af1029bc2d8c;p=fontconfig.git diff --git a/src/fccache.c b/src/fccache.c index e289c5d..7e2c1be 100644 --- a/src/fccache.c +++ b/src/fccache.c @@ -213,6 +213,17 @@ struct _FcCacheSkip { 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 @@ -223,7 +234,7 @@ static int 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)