File indexing completed on 2025-01-18 09:48:06
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_PREDEF_ENDIAN_H
0009 #define BOOST_PREDEF_ENDIAN_H
0010
0011 #include <boost/predef/version_number.h>
0012 #include <boost/predef/make.h>
0013 #include <boost/predef/library/c/gnu.h>
0014 #include <boost/predef/os/macos.h>
0015 #include <boost/predef/os/bsd.h>
0016 #include <boost/predef/platform/android.h>
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 #define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_NOT_AVAILABLE
0048 #define BOOST_ENDIAN_BIG_WORD BOOST_VERSION_NUMBER_NOT_AVAILABLE
0049 #define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_NOT_AVAILABLE
0050 #define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_NOT_AVAILABLE
0051
0052
0053
0054
0055 #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
0056 !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
0057 # if BOOST_LIB_C_GNU || BOOST_PLAT_ANDROID || BOOST_OS_BSD_OPEN
0058 # include <endian.h>
0059 # else
0060 # if BOOST_OS_MACOS
0061 # include <machine/endian.h>
0062 # else
0063 # if BOOST_OS_BSD
0064 # include <sys/endian.h>
0065 # endif
0066 # endif
0067 # endif
0068 # if defined(__BYTE_ORDER)
0069 # if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)
0070 # undef BOOST_ENDIAN_BIG_BYTE
0071 # define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0072 # endif
0073 # if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN)
0074 # undef BOOST_ENDIAN_LITTLE_BYTE
0075 # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0076 # endif
0077 # if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN)
0078 # undef BOOST_ENDIAN_LITTLE_WORD
0079 # define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE
0080 # endif
0081 # endif
0082 # if !defined(__BYTE_ORDER) && defined(_BYTE_ORDER)
0083 # if defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN)
0084 # undef BOOST_ENDIAN_BIG_BYTE
0085 # define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0086 # endif
0087 # if defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN)
0088 # undef BOOST_ENDIAN_LITTLE_BYTE
0089 # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0090 # endif
0091 # if defined(_PDP_ENDIAN) && (_BYTE_ORDER == _PDP_ENDIAN)
0092 # undef BOOST_ENDIAN_LITTLE_WORD
0093 # define BOOST_ENDIAN_LITTLE_WORD BOOST_VERSION_NUMBER_AVAILABLE
0094 # endif
0095 # endif
0096 #endif
0097
0098
0099
0100 #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
0101 !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
0102 # if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \
0103 (defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) || \
0104 defined(__ARMEB__) || \
0105 defined(__THUMBEB__) || \
0106 defined(__AARCH64EB__) || \
0107 defined(_MIPSEB) || \
0108 defined(__MIPSEB) || \
0109 defined(__MIPSEB__)
0110 # undef BOOST_ENDIAN_BIG_BYTE
0111 # define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0112 # endif
0113 #endif
0114
0115
0116
0117 #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
0118 !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
0119 # if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
0120 (defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \
0121 defined(__ARMEL__) || \
0122 defined(__THUMBEL__) || \
0123 defined(__AARCH64EL__) || \
0124 defined(__loongarch__) || \
0125 defined(_MIPSEL) || \
0126 defined(__MIPSEL) || \
0127 defined(__MIPSEL__) || \
0128 defined(__riscv) || \
0129 defined(__e2k__)
0130 # undef BOOST_ENDIAN_LITTLE_BYTE
0131 # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0132 # endif
0133 #endif
0134
0135
0136
0137
0138 #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
0139 !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
0140 # include <boost/predef/architecture.h>
0141 # if BOOST_ARCH_M68K || \
0142 BOOST_ARCH_PARISC || \
0143 BOOST_ARCH_SPARC || \
0144 BOOST_ARCH_SYS370 || \
0145 BOOST_ARCH_SYS390 || \
0146 BOOST_ARCH_Z
0147 # undef BOOST_ENDIAN_BIG_BYTE
0148 # define BOOST_ENDIAN_BIG_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0149 # endif
0150 # if BOOST_ARCH_IA64 || \
0151 BOOST_ARCH_X86 || \
0152 BOOST_ARCH_BLACKFIN
0153 # undef BOOST_ENDIAN_LITTLE_BYTE
0154 # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0155 # endif
0156 #endif
0157
0158
0159
0160
0161 #if !BOOST_ENDIAN_BIG_BYTE && !BOOST_ENDIAN_BIG_WORD && \
0162 !BOOST_ENDIAN_LITTLE_BYTE && !BOOST_ENDIAN_LITTLE_WORD
0163 # if BOOST_ARCH_ARM
0164 # include <boost/predef/os/windows.h>
0165 # if BOOST_OS_WINDOWS
0166 # undef BOOST_ENDIAN_LITTLE_BYTE
0167 # define BOOST_ENDIAN_LITTLE_BYTE BOOST_VERSION_NUMBER_AVAILABLE
0168 # endif
0169 # endif
0170 #endif
0171
0172 #if BOOST_ENDIAN_BIG_BYTE
0173 # define BOOST_ENDIAN_BIG_BYTE_AVAILABLE
0174 #endif
0175 #if BOOST_ENDIAN_BIG_WORD
0176 # define BOOST_ENDIAN_BIG_WORD_BYTE_AVAILABLE
0177 #endif
0178 #if BOOST_ENDIAN_LITTLE_BYTE
0179 # define BOOST_ENDIAN_LITTLE_BYTE_AVAILABLE
0180 #endif
0181 #if BOOST_ENDIAN_LITTLE_WORD
0182 # define BOOST_ENDIAN_LITTLE_WORD_BYTE_AVAILABLE
0183 #endif
0184
0185 #define BOOST_ENDIAN_BIG_BYTE_NAME "Byte-Swapped Big-Endian"
0186 #define BOOST_ENDIAN_BIG_WORD_NAME "Word-Swapped Big-Endian"
0187 #define BOOST_ENDIAN_LITTLE_BYTE_NAME "Byte-Swapped Little-Endian"
0188 #define BOOST_ENDIAN_LITTLE_WORD_NAME "Word-Swapped Little-Endian"
0189
0190 #endif
0191
0192 #include <boost/predef/detail/test.h>
0193 BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_BIG_BYTE,BOOST_ENDIAN_BIG_BYTE_NAME)
0194
0195 #include <boost/predef/detail/test.h>
0196 BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_BIG_WORD,BOOST_ENDIAN_BIG_WORD_NAME)
0197
0198 #include <boost/predef/detail/test.h>
0199 BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_LITTLE_BYTE,BOOST_ENDIAN_LITTLE_BYTE_NAME)
0200
0201 #include <boost/predef/detail/test.h>
0202 BOOST_PREDEF_DECLARE_TEST(BOOST_ENDIAN_LITTLE_WORD,BOOST_ENDIAN_LITTLE_WORD_NAME)