Microchip Technology SW006023-2 Data Sheet

Page of 238
MPLAB
®
 XC32 C/C++ Compiler User’s Guide
DS51686E-page 172
 2012 Microchip Technology Inc.
16.5
PREDEFINED MACROS
These predefined macros are available for use with the compiler:
16.5.1
32-Bit C/C++ Compiler Macros
The compiler defines a number of macros, most with the prefix “_MCHP_,” which 
characterize the various target specific options, the target processor and other aspects 
of the host environment.C/C++
_MCHP_SZINT
32 or 64, depending on command line options 
to set the size of an integer 
(-mint32 
-mint64)
_MCHP_SZLONG
32 or 64, depending on command line options 
to set the size of an integer 
(-mlong32 
-mlong64)
_MCHP_SZPTR
32 always since all pointers are 32 bits
__mchp_no_float
Defined if 
-mno-float
 specified
__NO_FLOAT
Defined if 
-mno-float
 specified
__PIC__
__pic__
The translation unit is being compiled for 
position independent code
__PIC32MX
__PIC32MX__
Always defined
__PIC32_FEATURE_SET__
The compiler predefines a macro based on 
the features available for the selected device. 
These macros are intended to be used when 
writing code to take advantage of features 
available on newer devices while maintaining 
compatibility with older devices.
Examples: PIC32MX795F512L would use 
__PIC32_FEATURE_SET__ == 795
and PIC32MX340F128H would use 
__PIC32_FEATURE_SET__ == 340
PIC32MX
Defined if 
-ansi
 is not specified
__LANGUAGE_ASSEMBLY
__LANGUAGE_ASSEMBLY__
_LANGUAGE_ASSEMBLY
Defined if compiling a pre-processed 
assembly file (.S files)
LANGUAGE_ASSEMBLY
Defined if compiling a pre-processed 
assembly file (.S files) and 
-ansi
 is not 
specified
__LANGUAGE_C
__LANGUAGE_C__
_LANGUAGE_C
Defined if compiling a C file
LANGUAGE_C
Defined if compiling a C file and 
-ansi
 is not 
specified
__LANGUAGE_C_PLUS_PLUS
__cplusplus
_LANGUAGE_C_PLUS_PLUS__
Defined if compiling a C++ file
__EXCEPTIONS
Defined if X++ exceptions are enabled
__GXX_RTTI
Defined if runtime type information is enabled