Changed MinGW __forceinline strategy to something with less side effects
This commit is contained in:
@@ -27,11 +27,8 @@
|
|||||||
// fix a MinGW build issue "error: multiple storage classes in declaration specifiers" due to MinGW
|
// fix a MinGW build issue "error: multiple storage classes in declaration specifiers" due to MinGW
|
||||||
// defining extern for __forceinline types
|
// defining extern for __forceinline types
|
||||||
#if (defined(__MINGW32__) || defined(__MINGW64__)) && defined(__GNUC__)
|
#if (defined(__MINGW32__) || defined(__MINGW64__)) && defined(__GNUC__)
|
||||||
// MinGW winnt.h uses FORCEINLINE which is originally defined as __forceinline, but requires extern
|
#define MINGW_GCC
|
||||||
#undef FORCEINLINE
|
#define __mingw_forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
||||||
#define FORCEINLINE extern __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
|
||||||
#undef __forceinline
|
|
||||||
#define __forceinline __inline__ __attribute__((__always_inline__,__gnu_inline__))
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ static void ndpi_int_ftp_add_connection(struct ndpi_detection_module_struct *ndp
|
|||||||
*/
|
*/
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
@@ -78,8 +80,11 @@ u_int8_t ndpi_int_check_possible_ftp_command(const struct ndpi_packet_struct *pa
|
|||||||
/**
|
/**
|
||||||
* ftp replies are are 3-digit number followed by space or hyphen
|
* ftp replies are are 3-digit number followed by space or hyphen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
@@ -108,6 +113,8 @@ u_int8_t ndpi_int_check_possible_ftp_reply(const struct ndpi_packet_struct *pack
|
|||||||
*/
|
*/
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -39,8 +39,11 @@ static void ndpi_int_irc_add_connection(struct ndpi_detection_module_struct *ndp
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -81,6 +81,8 @@ static const u_int16_t ndpi_valid_qq_versions[] = {
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
@@ -172,6 +174,8 @@ u_int8_t ndpi_is_valid_qq_packet(const struct ndpi_packet_struct *packet)
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
@@ -428,6 +432,8 @@ static void ndpi_search_qq_udp(struct ndpi_detection_module_struct *ndpi_struct,
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ static void ndpi_int_rtp_add_connection(struct ndpi_detection_module_struct
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
@@ -162,6 +164,8 @@ void init_seq(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ static void ndpi_int_sip_add_connection(struct ndpi_detection_module_struct *ndp
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -43,6 +43,8 @@ static void ndpi_int_sopcast_add_connection(struct ndpi_detection_module_struct
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ static void ndpi_int_telnet_add_connection(struct ndpi_detection_module_struct
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ static void ndpi_int_thunder_add_connection(struct ndpi_detection_module_struct
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
@@ -81,6 +83,8 @@ void ndpi_int_search_thunder_udp(struct ndpi_detection_module_struct
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
@@ -139,6 +143,8 @@ void ndpi_int_search_thunder_tcp(struct ndpi_detection_module_struct
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ static void ndpi_int_worldofwarcraft_add_connection(struct ndpi_detection_module
|
|||||||
|
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -52,8 +52,10 @@ static u_int8_t ndpi_check_for_YmsgCommand(u_int16_t len, const u_int8_t * ptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifndef WIN32
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -24,8 +24,10 @@
|
|||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_ZATTOO
|
#ifdef NDPI_PROTOCOL_ZATTOO
|
||||||
|
|
||||||
#ifndef WIN32
|
#if !defined(WIN32)
|
||||||
static inline
|
static inline
|
||||||
|
#elif defined(MINGW_GCC)
|
||||||
|
__mingw_forceinline static
|
||||||
#else
|
#else
|
||||||
__forceinline static
|
__forceinline static
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user