Bug 74603 - Build for AIX of fccompat.c fails with wrong number of arguments for initstate_r()
Summary: Build for AIX of fccompat.c fails with wrong number of arguments for initstat...
Alias: None
Product: fontconfig
Classification: Unclassified
Component: library (show other bugs)
Version: unspecified
Hardware: PowerPC AIX
: medium normal
Assignee: Akira TAGOH
QA Contact: Behdad Esfahbod
Depends on:
Reported: 2014-02-06 07:56 UTC by Dirk
Modified: 2014-02-06 10:52 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:

AIX patch for random_r (832 bytes, text/plain)
2014-02-06 09:53 UTC, Dirk

Description Dirk 2014-02-06 07:56:00 UTC
AIX does define initstate_r(), which autoconf is correctly picking up. However the prototype of the IBM initstate_r() has five arguments, and does not match the linux prototype with four arguments. The random_r() prototype is also different to linux prototype.

Patching ling 169 in fccompat.c from 
#if defined(HAVE_RANDOM_R) && !defined(_AIX)

allows the compile to go through OK, and all looks to be well.
Comment 1 Akira TAGOH 2014-02-06 09:03:03 UTC
Using reentrant one would be safe and ideal solution IMHO. just disabling it for AIX looks wrong to me, particularly for where it is available. probably we should simply support that with ifdef'd.
Comment 2 Dirk 2014-02-06 09:53:50 UTC
Created attachment 93515 [details]
AIX patch for random_r
Comment 3 Dirk 2014-02-06 09:55:14 UTC
I see that someone at 


has alraedy had a go at this, but it seems to me that this patch is specific to aix, and breaks a build on any other platform where the reentrant prototype exists.

How about the attached?
Comment 4 Akira TAGOH 2014-02-06 10:42:58 UTC
Thanks. revised a bit and pushed into git.
Comment 5 Dirk 2014-02-06 10:52:32 UTC

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.