]> The Tcpdump Group git mirrors - libpcap/commitdiff
Check for VS 2015 before including <inttypes.h>.
authorGuy Harris <[email protected]>
Sun, 11 Aug 2019 20:49:50 +0000 (13:49 -0700)
committerGuy Harris <[email protected]>
Sun, 11 Aug 2019 20:49:50 +0000 (13:49 -0700)
That way, with older versions of VS that lack <inttypes.h>, the error
will be a little clearer as to what the problem is.

Clean up comments to be more like what tcpdump has.

pcap/pcap-inttypes.h

index 01a8ffc9e21d1cefc843ca13a8026bb9c3d52907..1cfa0bfc333990143252035256fd91ba16fc423d 100644 (file)
 #define pcap_pcap_inttypes_h
 
 /*
- * Get the integer types and PRi[doux]64 values from C99 <inttypes.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
+ * sufficient C99 support there.
+ */
+#if defined(_MSC_VER)
+  /*
+   * Compiler is MSVC.  Make sure we have VS 2015 or later.
+   */
+  #if _MSC_VER < 1900
+    #error "Building libpcap requires VS 2015 or later"
+  #endif
+#endif
+
+/*
+ * 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
  * I.e., assume we have <inttypes.h> and that it suffices.
  */
 
-#if defined(_MSC_VER)
-  /*
-   * Compiler is MSVC.  Make sure we have VS 2015 or later.
-   */
-  #if _MSC_VER < 1900
-    #error "Building libpcap requires VS 2015 or later"
-  #endif
-#endif
-
 /*
  * XXX - somehow make sure we have enough C99 support with other
  * compilers and support libraries?