The following predefined macros are provided to facilitate porting applications between platforms. All platform-related predefined macros are unprotected and may be undefined or redefined without warning unless otherwise specified.
| Predefined macro name | Description | Predefined value | Predefined under the following conditions |
|---|---|---|---|
| _BIG_ENDIAN, __BIG_ENDIAN__ | Indicates that the platform is big-endian (that is, the most significant byte is stored at the memory location with the lowest address). | 1 | Always predefined. |
| __ELF__ | Indicates that the ELF object model is in effect. | 1 | Always predefined for the Linux® platform. |
__GXX_WEAK__ |
Indicates that weak symbols are supported (used for template instantiation by the linker). | 1 | Always predefined. |
| __HOS_LINUX__ | Indicates that the host operating system is Linux. Protected. | 1 | Always predefined for all Linux platforms. |
| _ILP32, __ILP32__ | Indicates that the target platform uses 32-bit int, long int, and pointer types. | 1 | Predefined when the target platform uses 32-bit int, long int, and pointer types. |
| __linux, __linux__ | Indicates that the platform is Linux. | 1 | Always predefined for all Linux platforms. |
| _LP64, __LP64__ | Indicates that the target platform uses 64-bit long int and pointer types, and a 32-bit int type. | 1 | Predefined when the target platform uses 64-bit long int and pointer types, and 32-bit a int type. |
| __powerpc, __powerpc__ | Indicates that the target is a Power architecture. | 1 | Predefined when the target is a Power architecture. |
| __powerpc64__ | Indicates that the target is a Power architecture and that 64-bit compilation mode is enabled. | 1 | Predefined when the target is a Power architecture and -q64 is in effect. |
| __PPC, __PPC__ | Indicates that the target is a Power architecture. | 1 | Predefined when the target is a Power architecture. |
| __PPC64__ | Indicates that the target is a Power architecture and that 64-bit compilation mode is enabled. | 1 | Predefined when the target is a Power architecture and -q64 is in effect. |
| __THW_PPC__ | Indicates that the target is a Power architecture. | 1 | Predefined when the target is a Power architecture. |
| __TOS_LINUX__ | Indicates that the target operating system is Linux. | 1 | Predefined when the target is a Power architecture. |
| __unix, __unix__ | Indicates that the operating system is a variety of UNIX®. | 1 | Always predefined. |