From 33e0be73f7d7b398b246933f67c643a467b7f8f2 Mon Sep 17 00:00:00 2001 From: Jacob Masen-Smith Date: Wed, 22 Nov 2017 01:11:31 -0800 Subject: Fixed ndpi_win32.h so that it compiles on MinGW+GCC --- src/include/ndpi_win32.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/include/ndpi_win32.h') diff --git a/src/include/ndpi_win32.h b/src/include/ndpi_win32.h index 8a952b293..d4109dcb2 100644 --- a/src/include/ndpi_win32.h +++ b/src/include/ndpi_win32.h @@ -24,7 +24,18 @@ #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__) +// MinGW winnt.h uses FORCEINLINE which is originally defined as __forceinline, but requires extern +#undef FORCEINLINE +#define FORCEINLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) +#undef __forceinline +#define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__)) +#endif + #include +#include #include #include #include @@ -40,7 +51,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; -- cgit v1.2.3