24.4.15 Manifest Macros

The CCI defines the general form for macros that manifest the compiler and target device characteristics. These macros can be used to conditionally compile alternate source code based on the compiler or the target device.

The macros and macro families are details in the following table.

Table 24-1. Manifest Macros Defined by the CCI
NameMeaning if definedExample
__XC__Compiled with an MPLAB XC compiler__XC__
__CCI__Compiler is CCI compliant and CCI enforcement is enabled__CCI__
__XC#__The specific XC compiler used (# can be 8, 16, _DSC or 32)__XC32__
__DEVICEFAMILY__The family of the selected target device__dsPIC30F__
__DEVICENAME__The selected target device name__33ck256mp508__

Example

The following shows code that is conditionally compiled dependent on the device having EEPROM memory.

#ifdef __XC_DSC__
void __interrupt(__auto_psv__) myIsr(void)
#else
void __interrupt(low_priority) myIsr(void)
#endif

Differences

Some of these CCI macros are new (for example, __CCI__), and others have different names to previous symbols with identical meaning (for example, __33ck256mp508 is now __33ck256mp508__).

Migration to the CCI

Any code that uses compiler-defined macros needs review. Old macros continue to work as expected, but they are not compliant with the CCI.

Caveats

None.