diff options
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__ */ |