On Fri, 2009-03-27 at 17:35 +0000, Ghee Teo wrote:
> Hi,
> 
> I am working on patches that get the compiler to conditional include or 
> exclude the OpenSolaris specific bit of code.
> I have seen upstream code that used
> 
> #if defined(__sun__)
> ...
> #endif
> 
> But that does not work for CBE when I build them.
> 
> I have to use
> 
> #if defined(sun)
> ...
> #endif
> 
> So what is the right macros to use that work both down stream and upstream?
> Where are they defined, any idea?

These macros are usually defined by the compiler itself, or more
specifically by the preprocessor.  I don't know of a way to find out the
preprocessor defines for SunCC, but I know how to do it with GCC:

$ cpp -dM /dev/null

Maybe someone else knows how to print them with SunCC...

-- Christian


Reply via email to