mikroC
making it simple...
A macro won't be expanded during its own expansion (so
MACRO
Let's have an example:
/* Here are some simple macros: */
#define ERR_MSG "Out of range!"
#define EVERLOOP for( ; ; )
/* which we could use like this: */
main() {
EVERLOOP {
}
}
Attempting to redefine an already defined macro identifier will result in a warning
unless the new definition is exactly the same token-by-token definition as the
existing one. The preferred strategy where definitions might exist in other header
files is as follows:
#ifndef BLOCK_SIZE
#define BLOCK_SIZE 512
#endif
The middle line is bypassed if
is not currently defined, the middle line is invoked to define it.
MikroElektronika: Development tools - Books - Compilers
won't expand indefinitely).
...
if (error) {Lcd_Out_Cp(ERR_MSG); break;}
...
mikroC - C Compiler for Microchip PIC microcontrollers
is currently defined; if
BLOCK_SIZE
#define MACRO
BLOCK_SIZE
page
127
Need help?
Do you have a question about the PIC Microcontrollers PIC12 and is the answer not in the manual?