From 4c776501a652fc8b90fdf8098a20c5099b0fcfce Mon Sep 17 00:00:00 2001 From: Toni Uhlig Date: Tue, 8 Sep 2020 19:52:46 +0200 Subject: Fixed shlib xcompile for x86_64-w64-mingw32 Signed-off-by: Toni Uhlig --- src/include/ndpi_win32.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/include/ndpi_win32.h') diff --git a/src/include/ndpi_win32.h b/src/include/ndpi_win32.h index a39a2401a..c3403c009 100644 --- a/src/include/ndpi_win32.h +++ b/src/include/ndpi_win32.h @@ -31,6 +31,8 @@ #define __mingw_forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__)) #endif +#undef _WIN32_WINNT +#define _WIN32_WINNT _WIN32_WINNT_WIN8 #include #include #include @@ -39,6 +41,7 @@ #include /* getopt from: http://www.pwilson.net/sample.html. */ #include /* for getpid() and the exec..() family */ #include +#include #ifndef _CRT_SECURE_NO_WARNINGS #define _CRT_SECURE_NO_WARNINGS @@ -48,6 +51,17 @@ #define IPVERSION 4 /* on *nix it is defined in netinet/ip.h */ +#ifndef MIN +#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y)) +#endif + +#ifndef IPPROTO_SCTP +#define IPPROTO_SCTP 132 +#endif + +#undef gettimeofday +#define gettimeofday mingw_gettimeofday + extern char* strsep(char **sp, char *sep); typedef unsigned char u_char; @@ -79,4 +93,11 @@ extern unsigned long waitForNextEvent(unsigned long ulDelay /* ms */); #define strtok_r strtok_s #define timegm _mkgmtime +static inline struct tm * localtime_r(const time_t *timep, struct tm * result) +{ + struct tm *timeinfo; + timeinfo = localtime(timep); + return timeinfo; +} + #endif /* __NDPI_WIN32_H__ */ -- cgit v1.2.3