Sun Studio 12 Update 1: C++ User's Guide

A.2.9.1 Values

The following table shows the predefined macros. You can use these values in such preprocessor conditionals as #ifdef.

Table A–2 Predefined Macros

Platform 

Macro Name  

Notes  

SPARC and x86 

_ _ARRAYNEW

_ _ARRAYNEW is defined if the “array” forms of operators new and delete are enabled. See -features=[no%]arraynew for more information.

 

_BUILTIN_VA_ARG_INCR

For the _ _builtin_alloca, _ _builtin_va_alist, and _ _builtin_va_arg_incr keywords in varargs.h, stdarg.h, and sys/varargs.h.

 

__DATE__

 
 

__FILE__

 
 

__LINE__

 
 

__STDC__

Set to 0 (zero) 

 

__SUNPRO_CC=0x510

The value of _ _SUNPRO_CC indicates the release number of the compiler

 

__SUNPRO_CC_COMPAT=4 or __SUNPRO_CC_COMPAT=5

See A.2.7 –compat[={4|5}]

 

__TIME__

 
 

__cplusplus

 
 

__`uname -s`_`uname -r | tr . _`

Where uname -s is the output of uname –s and uname -r is the output of uname -r with the invalid characters, such as periods (.), replaced by underscores, as in -D_ _SunOS_5_9 and -D_ _SunOS_5_10.

 

__unix

 
 

_BOOL

_BOOL is defined if type bool is enabled. See -features=[no%]bool for more information.

 

_WCHAR_T

 
 

unix

See Interactions.

SPARC 

__SUN_PREFETCH=1

 
 

__SunOS_OSversion _OSversion

 
 

__SVR4

 
 

__sparc

 
 

__sun

 
 

sparc

See Interactions.

 

sun

See Interactions.

SPARC v9

__sparcv9

64-bit compilation modes only 

x86 

i386

 
 

linux

 
 

__amd64

 
 

__gnu__linux__

 
 

__i386

See Interactions.

 

__linux

 
 

__linux__

 
 

__x86_64

 

If you do not use =def, name is defined as 1.

Interactions

If +p is used, sun, unix, sparc, and i386 are not defined.

See also

–U