[...]
>(4) Platform dependent code
> like "#ifdef SPARC" code. What are the
> typical example of platform (SPARC vs.
> x86) dependent code? 

Plenty.  "#ifdef SPARC" is inappropriate as a way to identify Solaris, use it 
only if you really
are doing something essentially SPARC-specific.  Many people think #ifdefs 
should identify
_features_ rather than platforms, and something else should determine which 
features
to enable for a given platform (of even as options in a particular build).  But 
if you need to
identify Solaris using only predefined preprocessor symbols, I _think_ (not 
sure if it works on x86)
the way that works on both Sun Studio and gcc is

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

Otherwise: depending on byte order, alignment, assembler, hardware features, or 
software
features specific to only SPARC or x86 may not work as desired across the two.  
That's not
as much as it sounds like, and yet (as in other replies showing byte-order 
errors) may include
common errors of omission (which may be harder to spot than the obvious things).
 
 
This message posted from opensolaris.org
_______________________________________________
opensolaris-discuss mailing list
[email protected]

Reply via email to