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?


If someone is interested in platform detection, he/she might look into the file
libscg/scsihack.c from the cdrtools sources. It makes sense to use this kind of 
code if you like to select a SCSI generic driver adoption layer but not if you 
like to check whether you have some "Solaris specific" feature on the target 
platform. The latter is better dealt with by using dynamic autoconfiguration.

Jörg

-- 
 EMail:[EMAIL PROTECTED] (home) Jörg Schilling D-13353 Berlin
       [EMAIL PROTECTED]                (uni)  
       [EMAIL PROTECTED]     (work) Blog: http://schily.blogspot.com/
 URL:  http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to