]> The Tcpdump Group git mirrors - libpcap/commitdiff
Made pcap-stdinc.h more readable.
authorGisle Vanem <[email protected]>
Sat, 10 May 2014 13:27:52 +0000 (06:27 -0700)
committerGisle Vanem <[email protected]>
Sat, 10 May 2014 13:27:52 +0000 (06:27 -0700)
Include "IP6_misc.h" for all targets. Use non-Posix names for all MSVC-versions.

pcap-stdinc.h

index cbf9abf6427503547fa6ecf8692bbe5df523a657..ead359ed9d90d6ca4b872c1cb431d0039d07ed74 100644 (file)
 #define pcap_stdinc_h
 
 /*
- * Avoids a compiler warning in case this was already defined      
+ * Avoids a compiler warning in case this was already defined
  * (someone defined _WINSOCKAPI_ when including 'windows.h', in order
  * to prevent it from including 'winsock.h')
  */
 #ifdef _WINSOCKAPI_
 #undef _WINSOCKAPI_
 #endif
-#include <winsock2.h>
 
+#include <winsock2.h>
 #include <fcntl.h>
-
-#include "bittypes.h"
 #include <time.h>
 #include <io.h>
 
-#ifndef __MINGW32__
+#include "bittypes.h"
 #include "IP6_misc.h"
-#endif
 
 #define caddr_t char*
 
-#if _MSC_VER < 1500
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#define strdup _strdup
+#if !defined(HAVE_SNPRINTF) || (_MSC_VER < 1500)
+  #define snprintf  _snprintf
+  #define vsnprintf _vsnprintf
+  #define strdup    _strdup
 #endif
 
-#define inline __inline 
+#define inline __inline
 
 #ifdef __MINGW32__
-#include <stdint.h>
-#else /*__MINGW32__*/
-/* MSVC compiler */
-#ifndef _UINTPTR_T_DEFINED
-#ifdef  _WIN64
-typedef unsigned __int64    uintptr_t;
+  #include <stdint.h>
 #else
-typedef _W64 unsigned int   uintptr_t;
-#endif
-#define _UINTPTR_T_DEFINED
-#endif
-
-#ifndef _INTPTR_T_DEFINED
-#ifdef  _WIN64
-typedef __int64    intptr_t;
-#else
-typedef _W64 int   intptr_t;
-#endif
-#define _INTPTR_T_DEFINED
-#endif 
+  #ifndef _UINTPTR_T_DEFINED
+    #ifdef  _WIN64
+      typedef unsigned __int64    uintptr_t;
+    #else
+      typedef _W64 unsigned int   uintptr_t;
+    #endif
+    #define _UINTPTR_T_DEFINED
+  #endif
 
+  #ifndef _INTPTR_T_DEFINED
+    #ifdef  _WIN64
+      typedef __int64    intptr_t;
+    #else
+      typedef _W64 int   intptr_t;
+    #endif
+    #define _INTPTR_T_DEFINED
+  #endif
 #endif /*__MINGW32__*/
+
 #endif /* pcap_stdinc_h */