clang 23.0.0git
endian.h File Reference
#include <stdint.h>

Go to the source code of this file.

Macros

#define __CLANG_ENDIAN_CAST(cast, type, value)
#define LITTLE_ENDIAN   __ORDER_LITTLE_ENDIAN__
#define BIG_ENDIAN   __ORDER_BIG_ENDIAN__
#define PDP_ENDIAN   __ORDER_PDP_ENDIAN__
#define BYTE_ORDER   __BYTE_ORDER__
#define __BYTE_ORDER   BYTE_ORDER
#define __LITTLE_ENDIAN   LITTLE_ENDIAN
#define __BIG_ENDIAN   BIG_ENDIAN
#define __PDP_ENDIAN   PDP_ENDIAN
#define htobe16(x)
#define htobe32(x)
#define htobe64(x)
#define htole16(x)
#define htole32(x)
#define htole64(x)
#define be16toh(x)
#define be32toh(x)
#define be64toh(x)
#define le16toh(x)
#define le32toh(x)
#define le64toh(x)

Macro Definition Documentation

◆ __BIG_ENDIAN

#define __BIG_ENDIAN   BIG_ENDIAN

Definition at line 39 of file endian.h.

◆ __BYTE_ORDER

#define __BYTE_ORDER   BYTE_ORDER

Definition at line 33 of file endian.h.

◆ __CLANG_ENDIAN_CAST

#define __CLANG_ENDIAN_CAST ( cast,
type,
value )
Value:
((type)(value))

Definition at line 23 of file endian.h.

◆ __LITTLE_ENDIAN

#define __LITTLE_ENDIAN   LITTLE_ENDIAN

Definition at line 36 of file endian.h.

◆ __PDP_ENDIAN

#define __PDP_ENDIAN   PDP_ENDIAN

Definition at line 42 of file endian.h.

◆ be16toh

#define be16toh ( x)
Value:
__builtin_bswap16(__CLANG_ENDIAN_CAST(static_cast, uint16_t, x))
#define __CLANG_ENDIAN_CAST(cast, type, value)
Definition endian.h:23

Definition at line 56 of file endian.h.

◆ be32toh

#define be32toh ( x)
Value:
__builtin_bswap32(__CLANG_ENDIAN_CAST(static_cast, uint32_t, x))

Definition at line 58 of file endian.h.

◆ be64toh

#define be64toh ( x)
Value:
__builtin_bswap64(__CLANG_ENDIAN_CAST(static_cast, uint64_t, x))

Definition at line 60 of file endian.h.

◆ BIG_ENDIAN

#define BIG_ENDIAN   __ORDER_BIG_ENDIAN__

Definition at line 27 of file endian.h.

◆ BYTE_ORDER

#define BYTE_ORDER   __BYTE_ORDER__

Definition at line 29 of file endian.h.

◆ htobe16

#define htobe16 ( x)
Value:
__builtin_bswap16(__CLANG_ENDIAN_CAST(static_cast, uint16_t, x))

Definition at line 47 of file endian.h.

◆ htobe32

#define htobe32 ( x)
Value:
__builtin_bswap32(__CLANG_ENDIAN_CAST(static_cast, uint32_t, x))

Definition at line 49 of file endian.h.

◆ htobe64

#define htobe64 ( x)
Value:
__builtin_bswap64(__CLANG_ENDIAN_CAST(static_cast, uint64_t, x))

Definition at line 51 of file endian.h.

◆ htole16

#define htole16 ( x)
Value:
__CLANG_ENDIAN_CAST(static_cast, uint16_t, x)

Definition at line 53 of file endian.h.

◆ htole32

#define htole32 ( x)
Value:
__CLANG_ENDIAN_CAST(static_cast, uint32_t, x)

Definition at line 54 of file endian.h.

◆ htole64

#define htole64 ( x)
Value:
__CLANG_ENDIAN_CAST(static_cast, uint64_t, x)

Definition at line 55 of file endian.h.

◆ le16toh

#define le16toh ( x)
Value:
__CLANG_ENDIAN_CAST(static_cast, uint16_t, x)

Definition at line 62 of file endian.h.

◆ le32toh

#define le32toh ( x)
Value:
__CLANG_ENDIAN_CAST(static_cast, uint32_t, x)

Definition at line 63 of file endian.h.

◆ le64toh

#define le64toh ( x)
Value:
__CLANG_ENDIAN_CAST(static_cast, uint64_t, x)

Definition at line 64 of file endian.h.

◆ LITTLE_ENDIAN

#define LITTLE_ENDIAN   __ORDER_LITTLE_ENDIAN__

Definition at line 26 of file endian.h.

◆ PDP_ENDIAN

#define PDP_ENDIAN   __ORDER_PDP_ENDIAN__

Definition at line 28 of file endian.h.