diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2020-09-08 19:52:46 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2020-09-08 19:52:46 +0200 |
commit | 4c776501a652fc8b90fdf8098a20c5099b0fcfce (patch) | |
tree | 4344f1529c161cd59f4c8fba886754e128171fd0 /src/include/ndpi_win32.h | |
parent | 8ed6409b350a8838b7905aa48b47e430ed48f959 (diff) |
Fixed shlib xcompile for x86_64-w64-mingw32
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/include/ndpi_win32.h')
-rw-r--r-- | src/include/ndpi_win32.h | 21 |
1 files changed, 21 insertions, 0 deletions
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 <winsock2.h> #include <windows.h> #include <ws2tcpip.h> @@ -39,6 +41,7 @@ #include <getopt.h> /* getopt from: http://www.pwilson.net/sample.html. */ #include <process.h> /* for getpid() and the exec..() family */ #include <stdint.h> +#include <time.h> #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__ */ |