[PPL-devel] A compilation issue on Solaris 10, amd64

Maciej Bliziński maciej at opencsw.org
Fri Aug 19 09:30:36 CEST 2011


2011/8/18 Roberto Bagnara <bagnara at cs.unipr.it>:
> On 08/17/11 22:25, Maciej Bliziński wrote:
>>
>> Hello,
>>
>> At OpenCSW, we're working on a Solaris port of PPL.  Dagobert
>> Michelsen has identified two issues, which are specific to compiling
>> on i386 or amd64. One is that there's a macro called "R1" defined on
>> Solaris, and the second is that an existing version() function (from
>> headers present on Solaris) results in an ambiguity which breaks
>> compilation. Patches are available at [1].
>
> Hi Maciej.
>
> In order to facilitate Solaris users, we would like to make corresponding
> changes to the versions in our Git repository.  Can you please indicate
> an #if expression that can reliably discriminate the versions of Solaris
> affected?  For example, we would like to have something like
>
> #if defined (__SVR4) && defined (__sun)
>
> // Solaris versions X, Y and Z define R1 in /usr/include/ia32/sys/reg.h.
> // This conflicts with the use or R1 being made in this proram.
> # undef R1
>
> #endif // defined (__SVR4) && defined (__sun)

Hi Roberto,

The best way that works for both the Solaris Studio compiler and GCC, is this:

#if defined(__sun) || defined(__sun__)
(...)
#endif

Maciej



More information about the PPL-devel mailing list