]> The Tcpdump Group git mirrors - tcpdump/blobdiff - netdissect-stdinc.h
remove redundant ND_TCHECK, let GET_ routines handle checks
[tcpdump] / netdissect-stdinc.h
index aed38b31c49935a4b0245682bde3e21422e706ef..8b8eaf9ae72d2733f0e582e0f74dacc6222316e7 100644 (file)
@@ -46,6 +46,9 @@
 #include "varattrs.h"
 
 /*
+ * If we're compiling with Visual Studio, make sure we have at least
+ * VS 2015 or later, so we have sufficient C99 support.
+ *
  * XXX - verify that we have at least C99 support on UN*Xes?
  *
  * What about MinGW or various DOS toolchains?  We're currently assuming
@@ -80,6 +83,9 @@
    */
 
   /*
+   * Include <inttypes.h> to get the integer types and PRi[doux]64 values
+   * defined.
+   *
    * If the compiler is MSVC, we require VS 2015 or newer, so we
    * have <inttypes.h> - and support for %zu in the formatted
    * printing functions.
     /*
      * Suppress definition of intN_t in bittypes.h, which might be included
      * by <pcap/pcap.h> in older versions of WinPcap.
-     * (Yes, HAVE_U_INTn_T, as the definition guards are UN*X-oriented, and
-     * we check for u_intN_t in the UN*X configure script.)
+     * (Yes, HAVE_U_INTn_T, as the definition guards are UN*X-oriented.)
      */
     #define HAVE_U_INT8_T
     #define HAVE_U_INT16_T
     #define HAVE_U_INT32_T
     #define HAVE_U_INT64_T
-
-    /*
-     * These may be defined by <inttypes.h>.  If not, define them
-     * ourselves.
-     *
-     * XXX - given the assumptions above, will they ever *not* be
-     * defined by <inttypes.h>?
-     *
-     * XXX - for MSVC, we always want the _MSC_EXTENSIONS versions.
-     * What about other compilers?  If, as the MinGW Web site says MinGW
-     * does, the other compilers just use Microsoft's run-time library,
-     * then they should probably use the _MSC_EXTENSIONS even if the
-     * compiler doesn't define _MSC_EXTENSIONS.
-     */
-    #ifndef PRId64
-      #ifdef _MSC_EXTENSIONS
-        #define PRId64 "I64d"
-      #else
-        #define PRId64 "lld"
-      #endif
-    #endif /* PRId64 */
-
-    #ifndef PRIo64
-      #ifdef _MSC_EXTENSIONS
-        #define PRIo64 "I64o"
-      #else
-        #define PRIo64 "llo"
-      #endif
-    #endif /* PRIo64 */
-
-    #ifndef PRIx64
-      #ifdef _MSC_EXTENSIONS
-        #define PRIx64 "I64x"
-      #else
-        #define PRIx64 "llx"
-      #endif
-    #endif
-
-    #ifndef PRIu64
-      #ifdef _MSC_EXTENSIONS
-        #define PRIu64 "I64u"
-      #else
-        #define PRIu64 "llu"
-      #endif
-    #endif
   #endif
 #endif /* HAVE_PCAP_PCAP_INTTYPES_H */
 
 #include <stdio.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#include <ctype.h>
 #include <time.h>
 #include <io.h>
 #include <fcntl.h>
    * by adding a preceding underscore; we *want* the UN*Xisms, so add
    * #defines to let us use them.
    */
-  #define isascii __isascii
   #define isatty _isatty
   #define stat _stat
   #define strdup _strdup
@@ -262,7 +220,6 @@ typedef char* caddr_t;
  * Includes and definitions for various flavors of UN*X.
  */
 
-#include <ctype.h>
 #include <unistd.h>
 #include <netdb.h>
 #include <sys/param.h>