--- fccompat.c 2013-10-11 05:10:18 +0200 +++ fontconfig-2.11.0/src/fccompat.c 2014-02-06 11:43:57 +0200 @@ -164,20 +164,35 @@ int32_t FcRandom(void) { - int32_t result; -#if HAVE_RANDOM_R +#ifdef _AIX + long result; +#else + int32_t result; +#endif + + +#ifdef HAVE_RANDOM_R static struct random_data fcrandbuf; static char statebuf[256]; + static char *randP; static FcBool initialized = FcFalse; if (initialized != FcTrue) { +# ifdef _AIX + initstate_r(time(NULL), statebuf, 256, &randP, &fcrandbuf); +# else initstate_r(time(NULL), statebuf, 256, &fcrandbuf); +# endif initialized = FcTrue; } +# ifdef _AIX + random_r(&result, &fcrandbuf); +# else random_r(&fcrandbuf, &result); +# endif #elif HAVE_RANDOM static char statebuf[256]; char *state;