On 05/29/13 11:41 PM, Jean-Pierre wrote:
What is the recommended way to state "This code is for Solaris-
derived OSes" (as opposed to Windows, Linux, etc.) ? This is a
frequent need when developping portable applications.

And, I expected "#ifdef _sun" to mean just that, irrespective of
compiler, instead of meaning "This code is meaningful to a
Sun-derived compiler".

"#ifdef __sun" means you are compiling on a SunOS kernel, such as
Solaris or illumos - you could be using Studio cc, GNU gcc, or
LLVM clang compilers.

"#ifdef __SUNPRO_C" means you are compiling with the Sun/Solaris Studio
compilers - you could be building on Solaris/illumos or on Linux.

These names are trapped in history, based on the original names for
these products and can't be changed without breaking compatibility.

--
        -Alan Coopersmith-              alan.coopersm...@oracle.com
         Oracle Solaris Engineering - http://blogs.oracle.com/alanc

_______________________________________________
oi-dev mailing list
oi-dev@openindiana.org
http://openindiana.org/mailman/listinfo/oi-dev

Reply via email to