diff options
author | Luca Deri <lucaderi@users.noreply.github.com> | 2017-11-28 17:51:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-28 17:51:53 +0100 |
commit | 8547b50be7159e47003ba0f18c342d055bd1cb18 (patch) | |
tree | 7ae6f4b6ed1804d1ddf8996122b8797a21adcf7c /src/include | |
parent | 7090ef838ced77d05a1071fb93e3bc0d0fd9aa95 (diff) | |
parent | 950f5db3dd2fda8159f2ba280d66d44103810aef (diff) |
Merge pull request #493 from evengx/dev
Fixed ndpi_win32.h so that it compiles on MinGW+GCC
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/ndpi_win32.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/ndpi_win32.h b/src/include/ndpi_win32.h index 8a952b293..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; |