Sun Studio 12: C++ User's Guide

A.2.9 -Dname[=def]

Defines the macro symbol name to the preprocessor.

Using this option is equivalent to including a #define directive at the beginning of the source. You can use multiple -D options.

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=0x590

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’

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