Re: Underscores in ifndef
The leading underscore is a way to try to avoid naming conflicts,
that is to avoid problems by the same symbol beeing used for different purposes.
The convention is that 'system libraries' use a leading underscore for macro symbols,
so application code and application libraries code should use macro symbols that do not start with underscore.
Whether code generated by MCC should be regarded as 'system' code, or 'application' code,
may be open to debate, but code generated MCC is tested together with the compiler that is expected to be used, so any conflict between symbols used by the compiler, and symbols used by MCC should have been solved already.
Device support header files, use symbols with a leading underscore for macro symbols for register bits and fields,
but SFR register names have no underscore, so SFR register names make a lot of reserved names without a leading underscore. These are mostly all uppercase names, except a few registers in PIC32 MIPS system coprocessor, CP0, but those registers cannot be accessed directly by C code anyway.