1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

sys/libc/endian: fix compilation on AVR

There is no need to use `__uint16_t` instead of `uint16_t` etc., so
let's just go with `uint16_t` and have AVR GCC happy.
This commit is contained in:
Marian Buschsieweke 2024-01-30 19:38:10 +01:00
parent e5f69206ad
commit 0d01356c9c
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6

View File

@ -76,30 +76,30 @@ uint64_t le64toh(uint64_t little_endian_64bits);/**< little endian to host, 64 b
#if BYTE_ORDER == LITTLE_ENDIAN
# define htobe16(_x) __builtin_bswap16(_x)
# define htole16(_x) ((__uint16_t)(_x))
# define htole16(_x) ((uint16_t)(_x))
# define be16toh(_x) __builtin_bswap16(_x)
# define le16toh(_x) ((__uint16_t)(_x))
# define le16toh(_x) ((uint16_t)(_x))
# define htobe32(_x) __builtin_bswap32(_x)
# define htole32(_x) ((__uint32_t)(_x))
# define htole32(_x) ((uint32_t)(_x))
# define be32toh(_x) __builtin_bswap32(_x)
# define le32toh(_x) ((__uint32_t)(_x))
# define le32toh(_x) ((uint32_t)(_x))
# define htobe64(_x) __builtin_bswap64(_x)
# define htole64(_x) ((__uint64_t)(_x))
# define htole64(_x) ((uint64_t)(_x))
# define be64toh(_x) __builtin_bswap64(_x)
# define le64toh(_x) ((__uint64_t)(_x))
# define le64toh(_x) ((uint64_t)(_x))
#elif BYTE_ORDER == BIG_ENDIAN
# define htole16(_x) __builtin_bswap16(_x)
# define htobe16(_x) ((__uint16_t)(_x))
# define htobe16(_x) ((uint16_t)(_x))
# define le16toh(_x) __builtin_bswap16(_x)
# define be16toh(_x) ((__uint16_t)(_x))
# define be16toh(_x) ((uint16_t)(_x))
# define htole32(_x) __builtin_bswap32(_x)
# define htobe32(_x) ((__uint32_t)(_x))
# define htobe32(_x) ((uint32_t)(_x))
# define le32toh(_x) __builtin_bswap32(_x)
# define be32toh(_x) ((__uint32_t)(_x))
# define be32toh(_x) ((uint32_t)(_x))
# define htole64(_x) __builtin_bswap64(_x)
# define htobe64(_x) ((__uint64_t)(_x))
# define htobe64(_x) ((uint64_t)(_x))
# define le64toh(_x) __builtin_bswap64(_x)
# define be64toh(_x) ((__uint64_t)(_x))
# define be64toh(_x) ((uint64_t)(_x))
#else
# error "Byte order not supported"
#endif