beautypg.com

Examples, Macros generated by the ide, Examples macros generated by the ide – Zilog Z8F0130 User Manual

Page 238

background image

Using the ANSI C-Compiler

UM013037-1212

214

Zilog Developer Studio II – Z8 Encore!
User Manual

Macros Generated by the IDE

– see page 214

Examples

The following program illustrates the use of some of these predefined macros:

#include

void main()

{

#ifdef __ZILOG__

printf("Zilog Compiler ");

#endif

#ifdef __ENCORE__

printf("for Z8 Encore! ");

#endif

#ifdef __EZ8__

printf("with eZ8 Cpu ");

#endif

#ifdef __ZDATE__

printf("built on %d.\n", __ZDATE__);

#endif

}

Macros Generated by the IDE

In addition to the above predefined macros, the ZDS II IDE generates the following mac-
ros:

The macros generated by the IDE can be checked, and added to, by going to the Prepro-
cessor page of the

Project Settings

dialog box (see the

C: Preprocessor Page

section on

page 80).

_DEBUG

Generated for DEBUG builds. This macro can be tested to insert
additional code in debug builds for sanity checking or to simplify
debugging.

NDEBUG

Generated for release builds. This macro, if defined, prevents the
assert

macro from generating any code.

_<cpu>

Where <cpu> is the CPU name, for example, _Z8F1680 or _Z8F0830.

_<variant>

Where <variant> is the specific variant of the CPU, for example,
_Z8F2480XX20XXSG or _Z8F0880XX20XXEG.