I have a header file that will be compiled by multiple different compilers. This being the case, I want to use #if statements to change the compilation flow based on the current compiler. In the Keil compiler case, I want to use the #pragma NOIV to disable vector table generation, so I used the following at the beginning of the file:
#if(__C51__)
/* some comment */ #pragma NOIV
#endif /* end __C51__ */
I received the C252 error about misplaced control lines. Looking at the documentation, blank lines and comment lines should be ignored, so I would expect what I have written to work, since the pre-processor should remove or add the pragma before the compiler is invoked. Is this case, or is it impossible to use control lines with #if statements?
Thanks, Ian.
Argh. Your comment is of course right and I missed the obvious there. Thanks for pointing out my foolish mistake.
-Ian