[csw-maintainers] Question regarding di(1) utility

Philip Brown phil at bolthole.com
Thu Jun 10 18:11:14 CEST 2010


On Thu, Jun 10, 2010 at 6:35 AM, Dagobert Michelsen <dam at opencsw.org> wrote:
>
> BTW, checking for 'sun' doesn't help, these are defined by Sun Studio:
> (from cc(1)):
>

Some corrections:


>>          These predefinitions are valid in all modes:
>...
>>                   __SVR4(SPARC)

__SVR4 is defined on both sparc and x86, with sun studio . both 11 and 12.
as is __sun

The nice thing is that gcc ALSO defines these. along with the more balanced
   __sun__. but that's not important :)
Thats why I have documented on http://www.bolthole.com/solaris, that
the best most portable way to auto-detect solaris, is

 #if defined (__SVR4) && defined (__sun)

(using either one of them by itself, may technically trigger the
clause on additional machine types, such as SVR4==HPUX(?), and __sun
on ye olde sunos 1.x


More information about the maintainers mailing list