Bug 74603

Summary: Build for AIX of fccompat.c fails with wrong number of arguments for initstate_r()
Product: fontconfig Reporter: Dirk <tomsies>
Component: libraryAssignee: Akira TAGOH <akira>
Status: RESOLVED FIXED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: akira, fontconfig-bugs
Version: unspecified   
Hardware: PowerPC   
OS: AIX   
Whiteboard:
i915 platform: i915 features:
Attachments: AIX patch for random_r

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 
#ifdef HAVE_RANDOM_R
to 
#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 

http://www.oss4aix.org/download/patches/fontconfig-2.10.1-aix.patch

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
Thanks!

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.