/usr/include/msgpack/predef/other/endian.h is in libmsgpack-dev 1.4.2-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | /*
Copyright Rene Rivera 2013-2014
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
*/
#ifndef MSGPACK_PREDEF_ENDIAN_H
#define MSGPACK_PREDEF_ENDIAN_H
#include <msgpack/predef/version_number.h>
#include <msgpack/predef/make.h>
#include <msgpack/predef/library/c/gnu.h>
#include <msgpack/predef/os/macos.h>
#include <msgpack/predef/os/bsd.h>
#include <msgpack/predef/os/android.h>
/*`
[heading `MSGPACK_ENDIAN_*`]
Detection of endian memory ordering. There are four defined macros
in this header that define the various generally possible endian
memory orderings:
* `MSGPACK_ENDIAN_BIG_BYTE`, byte-swapped big-endian.
* `MSGPACK_ENDIAN_BIG_WORD`, word-swapped big-endian.
* `MSGPACK_ENDIAN_LITTLE_BYTE`, byte-swapped little-endian.
* `MSGPACK_ENDIAN_LITTLE_WORD`, word-swapped little-endian.
The detection is conservative in that it only identifies endianness
that it knows for certain. In particular bi-endianness is not
indicated as is it not practically possible to determine the
endianness from anything but an operating system provided
header. And the currently known headers do not define that
programatic bi-endianness is available.
This implementation is a compilation of various publicly available
information and acquired knowledge:
# The indispensable documentation of "Pre-defined Compiler Macros"
[@http://sourceforge.net/p/predef/wiki/Endianness Endianness].
# The various endian specifications available in the
[@http://wikipedia.org/ Wikipedia] computer architecture pages.
# Generally available searches for headers that define endianness.
*/
#define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
#define MSGPACK_ENDIAN_BIG_WORD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
#define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
#define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_NOT_AVAILABLE
/* GNU libc provides a header defining __BYTE_ORDER, or _BYTE_ORDER.
* And some OSs provide some for of endian header also.
*/
#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
!MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
# if MSGPACK_LIB_C_GNU || MSGPACK_OS_ANDROID
# include <endian.h>
# else
# if MSGPACK_OS_MACOS
# include <machine/endian.h>
# else
# if MSGPACK_OS_BSD
# if MSGPACK_OS_BSD_OPEN
# include <machine/endian.h>
# else
# include <sys/endian.h>
# endif
# endif
# endif
# endif
# if defined(__BYTE_ORDER)
# if defined(__BIG_ENDIAN) && (__BYTE_ORDER == __BIG_ENDIAN)
# undef MSGPACK_ENDIAN_BIG_BYTE
# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
# if defined(__LITTLE_ENDIAN) && (__BYTE_ORDER == __LITTLE_ENDIAN)
# undef MSGPACK_ENDIAN_LITTLE_BYTE
# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
# if defined(__PDP_ENDIAN) && (__BYTE_ORDER == __PDP_ENDIAN)
# undef MSGPACK_ENDIAN_LITTLE_WORD
# define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
# endif
# if !defined(__BYTE_ORDER) && defined(_BYTE_ORDER)
# if defined(_BIG_ENDIAN) && (_BYTE_ORDER == _BIG_ENDIAN)
# undef MSGPACK_ENDIAN_BIG_BYTE
# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
# if defined(_LITTLE_ENDIAN) && (_BYTE_ORDER == _LITTLE_ENDIAN)
# undef MSGPACK_ENDIAN_LITTLE_BYTE
# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
# if defined(_PDP_ENDIAN) && (_BYTE_ORDER == _PDP_ENDIAN)
# undef MSGPACK_ENDIAN_LITTLE_WORD
# define MSGPACK_ENDIAN_LITTLE_WORD MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
# endif
#endif
/* Built-in byte-swpped big-endian macros.
*/
#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
!MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
# if (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)) || \
(defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)) || \
defined(__ARMEB__) || \
defined(__THUMBEB__) || \
defined(__AARCH64EB__) || \
defined(_MIPSEB) || \
defined(__MIPSEB) || \
defined(__MIPSEB__)
# undef MSGPACK_ENDIAN_BIG_BYTE
# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
#endif
/* Built-in byte-swpped little-endian macros.
*/
#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
!MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
# if (defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)) || \
(defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)) || \
defined(__ARMEL__) || \
defined(__THUMBEL__) || \
defined(__AARCH64EL__) || \
defined(_MIPSEL) || \
defined(__MIPSEL) || \
defined(__MIPSEL__)
# undef MSGPACK_ENDIAN_LITTLE_BYTE
# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
#endif
/* Some architectures are strictly one endianess (as opposed
* the current common bi-endianess).
*/
#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
!MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
# include <msgpack/predef/architecture.h>
# if MSGPACK_ARCH_M68K || \
MSGPACK_ARCH_PARISK || \
MSGPACK_ARCH_SPARC || \
MSGPACK_ARCH_SYS370 || \
MSGPACK_ARCH_SYS390 || \
MSGPACK_ARCH_Z
# undef MSGPACK_ENDIAN_BIG_BYTE
# define MSGPACK_ENDIAN_BIG_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
# if MSGPACK_ARCH_AMD64 || \
MSGPACK_ARCH_IA64 || \
MSGPACK_ARCH_X86 || \
MSGPACK_ARCH_BLACKFIN
# undef MSGPACK_ENDIAN_LITTLE_BYTE
# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
#endif
/* Windows on ARM, if not otherwise detected/specified, is always
* byte-swaped little-endian.
*/
#if !MSGPACK_ENDIAN_BIG_BYTE && !MSGPACK_ENDIAN_BIG_WORD && \
!MSGPACK_ENDIAN_LITTLE_BYTE && !MSGPACK_ENDIAN_LITTLE_WORD
# if MSGPACK_ARCH_ARM
# include <msgpack/predef/os/windows.h>
# if MSGPACK_OS_WINDOWS
# undef MSGPACK_ENDIAN_LITTLE_BYTE
# define MSGPACK_ENDIAN_LITTLE_BYTE MSGPACK_VERSION_NUMBER_AVAILABLE
# endif
# endif
#endif
#if MSGPACK_ENDIAN_BIG_BYTE
# define MSGPACK_ENDIAN_BIG_BYTE_AVAILABLE
#endif
#if MSGPACK_ENDIAN_BIG_WORD
# define MSGPACK_ENDIAN_BIG_WORD_BYTE_AVAILABLE
#endif
#if MSGPACK_ENDIAN_LITTLE_BYTE
# define MSGPACK_ENDIAN_LITTLE_BYTE_AVAILABLE
#endif
#if MSGPACK_ENDIAN_LITTLE_WORD
# define MSGPACK_ENDIAN_LITTLE_WORD_BYTE_AVAILABLE
#endif
#define MSGPACK_ENDIAN_BIG_BYTE_NAME "Byte-Swapped Big-Endian"
#define MSGPACK_ENDIAN_BIG_WORD_NAME "Word-Swapped Big-Endian"
#define MSGPACK_ENDIAN_LITTLE_BYTE_NAME "Byte-Swapped Little-Endian"
#define MSGPACK_ENDIAN_LITTLE_WORD_NAME "Word-Swapped Little-Endian"
#include <msgpack/predef/detail/test.h>
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_BIG_BYTE,MSGPACK_ENDIAN_BIG_BYTE_NAME)
#include <msgpack/predef/detail/test.h>
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_BIG_WORD,MSGPACK_ENDIAN_BIG_WORD_NAME)
#include <msgpack/predef/detail/test.h>
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_LITTLE_BYTE,MSGPACK_ENDIAN_LITTLE_BYTE_NAME)
#include <msgpack/predef/detail/test.h>
MSGPACK_PREDEF_DECLARE_TEST(MSGPACK_ENDIAN_LITTLE_WORD,MSGPACK_ENDIAN_LITTLE_WORD_NAME)
#endif
|