Joerg Schilling wrote:
> Keith M Wesolowski <[EMAIL PROTECTED]> wrote:
> 
>> On Thu, Mar 06, 2008 at 12:27:52PM -0800, Dan McDonald wrote:
>>
>>> I'm porting a large BSD and Linux app to OpenSolaris, and it would be 
>>> optimal if I could wrap
>>> my changes with:
>>>
>>> #ifdef <well-known-symbol>
>>> /* OpenSolaris-specific code goes here...  */
>>> #endif /* well-known-symbol */
>>>
>>> My first guess would've been simply "sun", but that may be more *Solaris* 
>>> and less
>>> *OpenSolaris*.
>> You can see a list of definitions by doing gcc -dD -E - </dev/null.
>> The first chunk is gcc-specific but the second one should be universal
>> (and in any case if gcc doesn't define the symbol but cc does it's not
>> very useful for this purpose anyway).  If you are going to do this,
>> I'd use the __ versions of these symbols.
> 
> Interesting! Is there something similar for Sun Studio?

Documented in the Sun Studio cc man page:

           Predefinitions:unix
                       sparc (SPARC)
                       i386 (x86)
                       sun

           The above are not predefined in -Xc mode.
           These predefinitions are valid in all modes:
                    __amd64(x86)
                    __x86_64(x86)
                    __sun
                    __unix
                    __SUNPRO_C=0x580
                    __`uname -s`_`uname -r`
                    __sparc (SPARC)
                    __sparcv9 (SPARC with -xarch=v9|v9a|v9b)
                    __i386 (x86)
                    __BUILTIN_VA_ARG_INCR
                    __SVR4


-- 
Darren J Moffat
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to