4.2.2 Macro

The predefined macro names in CC-RH are listed below.

Table 4.8

List of Supported Macros

Condition to be DefinedNote 1

Macro Name

Value

At all times

__LINE__

Line number of source line at that point (decimal)

At all times

__FILE__

Name of source file (character string constant)

At all times

__DATE__Note 2

Date of translating source file (character string constant)Note 3

At all times

__TIME__Note 2

Translation time of source file (character string constant)Note 4

When -strict_std is specified

__STDC__

1

When -lang=c99 is specified

__STDC_HOSTED__

0

At all times

__STDC_VERSION__

199409L (when -lang=c99 is not specified)

199901L (when -lang=c99 is specified)

When -lang=c99 is specified

__STDC_IEC_559__

1

At all times

__RENESAS__

1

At all times

__RENESAS_VERSION__

0xXXYYZZ00Note 5

At all times

__CCRH__

1

__CCRH

1

At all times

__RH850__

1

__RH850

1

At all times

__v850e3v5__

1

__v850e3v5

1

When -Xdbl_size=4 is specified

__DBL4

1

__DOUBLE_IS_32BITS__

1

When -Xdbl_size=8 is specified

__DBL8

1

__DOUBLE_IS_64BITS__

1

When -Xround=nearest is specified

__RON

1

When -Xround=zero is specified

__ROZ

1

When -Xbit_order=left is specified

__BITLEFT

1

When -Xbit_order=right is specified

__BITRIGHT

1

When -Xenum_type=auto is specified

__AUTO_ENUM

1

When -Xfloat=fpu is specified

__FPU

1

At all times

__CHAR_SIGNED__

1

When -Xreg_mode=32 is specified

__reg32__

1

When -Xreg_mode=22 is specified

__reg22__

1

When -Xreg_mode=common is specified

__reg_common__

1

At all times

_LIT

1

When -Xmulti_level=level is specified

__MULTI_LEVEL__

Value specified by level (decimal)

When -pic is specified

__PIC

1

When -pirod is specified

__PIROD

1

When -pid is specified

__PID

1

Note 1.

The condition specified by the option is applicable also for the interpretation when the option is omitted.

Note 2.

The date and time of translation can be obtained in any case; the __DATE__ and __TIME__ macro values are always defined.

Note 3.

Character string constant in the form of "Mmm dd yyyy". Here, the name of the month (Mmm) is the same as that generated by the asctime function stipulated by the C language standard (three alphabetic characters with only the first character being a capital letter). The first character of dd is blank if its value is less than 10.

Note 4.

Character string constant having a format of "hh:mm:ss" similar to the time created by the asctime function.

Note 5.

If the version is V.XX.YY.ZZ, this will be 0xXXYYZZ00.
Example V1.02.03 -> __RENESAS_VERSION__ = 0x01020300