|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
In A51, I can do the following:
$if (CPU=1 OR DISP=3)
with 2 or more conditions. However, in C51 I could not find a way to do this. The following code:
#if CPU==1 OR DISP==2
gives me an error message. What's wrong?
The #if preprocessor directive in C expects C operators to be used.
Try using the logical or operator ('||') as shown in the following.
#if CPU==1 || DISP==2
That should work.
Refer to a good C manual for more information about how to use the #if preprocessor directive.
Article last edited on: 2006-10-24 11:46:23
Did you find this article helpful? Yes No
How can we improve this article?