Hi,
I am use the ## as follows
#define ADC_SRV_DEV 1
#define ADCCON(dev, chan, reg) AD##dev##CON##chan##reg
then when I give ADCCON(ADC_SRV_DEV, 1, bits.FORM) = 3; // this is equavalent to AD1CON1bits.FORM = 3;
But for some reason it is taking it as ADADC_SRV_DEVCON1bits
Please help
All preprocessors are created equal?
In this context, yes.
Unless, of course, the OP's issue is due to a specific problem in the specific implementation...
It isn't. As I said, the issue is actually a 'C' one rather than one specific to any particular implementation. In other words, this is the expected and correct behaviour.
Or, possibly, not:
I've worked on projects where the "native" preprocessor had some limitations, so the preprocessor from a different compiler was used...
One project used the Borland preprocessor to pre-process files for a Microtec compiler.
No. But all that are unequal to the Keil preprocessors, regarding the issue at hand, are irrelevant anyway, because they're even more off-topic than the OP.
But, maybe, some preprocessors are more equal that others...?
"The issue is actually a 'C' one rather than one specific to any particular implementation."
The issue is regarding a Microchip toolchain.
The issue is actually a 'C' one rather than one specific to any particular implementation. The comp.lang.c faq has an example of how to achieve what the OP wants.
forum.microchip.com/fb.aspx
View all questions in Keil forum