But I have the p18f27j53.h include file in the source and I am the Configure/Select Device set to 18f27j53.If you include the __18CXX in your source file instead including the header file for the device you are using, the C18 compiler will pick up whatever header file matches the device type as selected by the IDE "Configure/Select Device..." setting.
That way simply changing the device type in the IDE setting will automatically change the header file that gets used by the compiler.
The compiler defines this macro name to indicate that C18 compiler is in use. I seem to remember that this is used by many libraries and user code to cater for different options with the same code.Predefined Macro Names
In addition to the standard predefined macro names, MPLAB C18 provides the following predefined macros:
__18CXX The constant 1, intended to indicate the MPLAB C18 compiler.
__PROCESSOR The constant 1 if compiled for the particular processor. For example, __18C452 would be defined as the constant 1 if compiled with the -p18c452 command-line option and __18F258 would be defined as the constant 1 if compiled with the -p18f258 command-line option.
__SMALL__ The constant 1 if compiled with the -ms command-line option.
__LARGE__ The constant 1 if compiled with the -ml command-line option.
__TRADITIONAL18__ The constant 1 if the Non-Extended mode is being used
(see Selecting the Mode).
__EXTENDED18__ The constant 1 if the Extended mode is being used
(see Selecting the Mode).
by Aaron Carman
by Aaron Carman