Mikroc – ABL electronic PIC Microcontrollers PIC16 User Manual

Page 142

Advertising
background image

Any processed

section

can contain further conditional clauses, nested to any

depth. Each nested

#else

,

#elif

, or

#endif

directive belongs to the closest pre-

ceding

#if

directive.

The net result of the preceding scenario is that only one code

section

(possibly

empty) will be compiled.

Directives

#ifdef

and

#ifndef

You can use the

#ifdef

and

#ifndef

directives anywhere

#if

can be used. The

#ifdef

and

#ifndef

conditional directives let you test whether an identifier is

currently defined or not. The line

#ifdef

identifier

has exactly the same effect as

#if 1

if

identifier

is currently defined, and the

same effect as

#if 0

if

identifier

is currently undefined. The other directive,

#ifndef

, tests true for the “not-defined” condition, producing the opposite

results.

The syntax thereafter follows that of the

#if

,

#elif

,

#else

, and

#endif

.

An identifier defined as NULL is considered to be defined.

mikroC - C Compiler for Microchip PIC microcontrollers

mikroC

making it simple...

134

MikroElektronika: Development tools - Books - Compilers

page

Advertising
This manual is related to the following products: