diff options
author | Luca Deri <deri@ntop.org> | 2023-10-16 16:17:41 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2023-10-16 16:17:41 +0200 |
commit | d9b0ba1d142f27ef436e8eae36ad0ab108794a42 (patch) | |
tree | f640996439628bfe70090dee46a30c7359804e1f /src/include/ndpi_define.h.in | |
parent | 16b4913be6395f79e98287e4d32dc5daf2d3f5c7 (diff) |
Windows warning checks
Diffstat (limited to 'src/include/ndpi_define.h.in')
-rw-r--r-- | src/include/ndpi_define.h.in | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/src/include/ndpi_define.h.in b/src/include/ndpi_define.h.in index 75f41dac2..c22d69823 100644 --- a/src/include/ndpi_define.h.in +++ b/src/include/ndpi_define.h.in @@ -394,33 +394,103 @@ static inline u_int64_t get_u_int64_t(const u_int8_t* X, int O) #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#ifndef htobe16 #define htobe16(x) htons(x) +#endif + +#ifndef htole16 #define htole16(x) (x) +#endif + +#ifndef be16toh #define be16toh(x) ntohs(x) +#endif + +#ifndef le16toh #define le16toh(x) (x) +#endif + +#ifndef htobe32 #define htobe32(x) htonl(x) +#endif + +#ifndef htole32 #define htole32(x) (x) +#endif + +#ifndef be32toh #define be32toh(x) ntohl(x) +#endif + +#ifndef le32toh #define le32toh(x) (x) +#endif + +#ifndef htobe64 #define htobe64(x) ndpi_htonll(x) +#endif + +#ifndef htole64 #define htole64(x) (x) +#endif + +#ifndef be64toh #define be64toh(x) ndpi_ntohll(x) +#endif + +#ifndef le64toh #define le64toh(x) (x) +#endif #elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ +#ifndef htobe16 #define htobe16(x) (x) +#endif + +#ifndef htole16 #define htole16(x) __builtin_bswap16(x) +#endif + +#ifndef be16toh #define be16toh(x) (x) +#endif + +#ifndef le16toh #define le16toh(x) __builtin_bswap16(x) +#endif + +#ifndef htobe32 #define htobe32(x) (x) +#endif + +#ifndef htole32 #define htole32(x) __builtin_bswap32(x) +#endif + +#ifndef be32toh #define be32toh(x) (x) +#endif + +#ifndef le32toh #define le32toh(x) __builtin_bswap32(x) +#endif + +#ifndef htobe64 #define htobe64(x) (x) +#endif + +#ifndef htole64 #define htole64(x) __builtin_bswap64(x) +#endif + +#ifndef be64toh #define be64toh(x) (x) +#endif + +#ifndef le64toh #define le64toh(x) __builtin_bswap64(x) +#endif #else #error Unexpected __BYTE_ORDER__ |