[csw-maintainers] #ifdef's for solaris versions

Laurent Blume laurent at opencsw.org
Sat Sep 7 19:28:28 CEST 2013

On 2013-09-07 5:57 PM, Maciej (Matchek) Bliziński wrote:
> 2013/9/7 Riccardo Mottola <rmottola at opencsw.org>
>> Are there reliable #ifdef's for identifying solaris? and then, in case, its versions? I need certain  workaround for solaris and, furthermore some are needed only for solaris 8/9, but no longer in 10+. (I'm struggling with the missing stdint.h and the incomplete inttypes.h)
> Why not have a ./configure test for the exact feature or bug you're
> interested in detecting, and an own #define?

Actually, so far, it's the *only* way.

Unlike for Linux distros,which are very stable, Solaris features do vary
a lot during the lifetime of a given release.

So, the major number is meaningless (you could even have the case where
a patched version N has a feature than an unpatched N+1 does not).

Update versions don't mean much, since you can get a feature via a patch
without changing the update,

Patch numbers are unreliable: you would need to know what patch number
introduced a feature, but it'll probably be rolled into another patch
later. And we're getting far of a simple #ifdef check here.

This is all less true in Solaris 11, which has tightened the
integration, and forces you the hard way to have an all or nothing
upgrade. It still remains to be seen how it will evolve.

So, like Maciej said - configure.


More information about the maintainers mailing list