diff options
Diffstat (limited to 'src/include/ndpi_win32.h')
-rw-r--r-- | src/include/ndpi_win32.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/include/ndpi_win32.h b/src/include/ndpi_win32.h index 175ecd57d..db309faff 100644 --- a/src/include/ndpi_win32.h +++ b/src/include/ndpi_win32.h @@ -24,7 +24,15 @@ #ifndef __NDPI_WIN32_H__ #define __NDPI_WIN32_H__ +// fix a MinGW build issue "error: multiple storage classes in declaration specifiers" due to MinGW +// defining extern for __forceinline types +#if (defined(__MINGW32__) || defined(__MINGW64__)) && defined(__GNUC__) +#define MINGW_GCC +#define __mingw_forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__)) +#endif + #include <winsock2.h> +#include <windows.h> #include <ws2tcpip.h> #include <process.h> #include <io.h> @@ -40,7 +48,7 @@ #define IPVERSION 4 /* on *nix it is defined in netinet/ip.h */ -extern char* strsep(char **sp, const char *sep); +extern char* strsep(char **sp, char *sep); typedef unsigned char u_char; typedef unsigned short u_short; @@ -63,6 +71,8 @@ typedef unsigned __int64 u_int64_t; #define gmtime_r(a, b) memcpy(b, gmtime(a), sizeof(struct tm)) +#define in_addr_t unsigned long + extern unsigned long waitForNextEvent(unsigned long ulDelay /* ms */); #define sleep(a /* sec */) waitForNextEvent(1000*a /* ms */) |