XTE _ ENDIAN
Defined in header <xte/preproc/endian.hpp> Macros for detecting the current endianness. Definitions are compiler-dependent and not mutually exclusive (e.g. for mixed-endianness).
Definitions
#bigDetects big-endianness (ABCD).#define XTE_ENDIAN_BIG /* boolean integer literal */
#little
Detects big-endianness (DCBA).#define XTE_ENDIAN_LITTLE /* boolean integer literal */
#big-word
Detects word-swapped big-endianness (CDAB), like Honeywell 316.#define XTE_ENDIAN_BIG_WORD /* boolean integer literal */
#little-word
Detects word-swapped little-endianness (BADC), like PDP-11.#define XTE_ENDIAN_LITTLE_WORD /* boolean integer literal */
Example
Possible preprocessor output:#if XTE_ENDIAN_BIG yup#else nop#endif
[View in Compiler Explorer]yup