From 960e8ab22a1291775bcef1021d6fa80d120d7968 Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Mon, 11 Oct 2021 20:59:28 +0200 Subject: Win fix --- src/include/ndpi_define.h.in | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/include/ndpi_define.h.in b/src/include/ndpi_define.h.in index e63a137b9..3c4a0ee6c 100644 --- a/src/include/ndpi_define.h.in +++ b/src/include/ndpi_define.h.in @@ -350,8 +350,16 @@ static inline u_int64_t get_u_int64_t(const u_int8_t* X, int O) #if defined(WIN32) #undef strtok_r #define strtok_r strtok_s + +#if BYTE_ORDER == LITTLE_ENDIAN +#define le16toh(x) (x) +#define le32toh(x) (x) +#else +#error "byte order not supported" #endif +#endif /* WIN32 */ + #define NDPI_MAX_DNS_REQUESTS 16 #define NDPI_MIN_NUM_STUN_DETECTION 8 -- cgit v1.2.3