Crossware

Table of Contents        Previous topic       Next topic       

C COMPILER->Predefined Macros->Compiler Specific Predefined Macros

In addition the following compiler specific predefined macros are supported:
    
_XC51_VERdefined as 200 for versions 2.XX of the 8051PSDS-A and C8051NT compilers,
defined as 300 for versions 3.XX of the C8051NT compiler
_X_I51TMdefined if the memory model is Tiny
_X_I51SMdefined if the memory model is Small (Direct and Indirect)
_X_I51LMdefined if the memory model is Large
_X_I51DMdefined if the memory model is Small Direct
_X_I51NRdefined within a function if that function is non-reentrant. Outside of a function it is defined if the compiler is generating non-reentrant functions by default
_X_LDBLE_BITSdefined as 64 for this standard version of the compiler,defined as 80 for the version that supports 80 bit long doubles
_atbitunless support for Tasking keywords has been disabled, _atbit is predefined as =(a)^(b).

Note for programmers upgrading from the 8051PSDS package:

For the 8051PSDS, _CX51_VER is not defined at all so if you want to modify your source code so that it is compatible with both new and old compilers, you can test for this predefined macro. For example with:

#ifndef _CX51_VER
#include <asmmacro.h>
#endif

asmmacro.h will only be included when you compile with the 8051PSDS.