]> The Tcpdump Group git mirrors - libpcap/commitdiff
Move the PRI[doux]64 definitions to pcap-types.h.
authorGuy Harris <[email protected]>
Tue, 5 Sep 2017 21:01:30 +0000 (14:01 -0700)
committerGuy Harris <[email protected]>
Tue, 5 Sep 2017 21:01:30 +0000 (14:01 -0700)
That's where we do the rest of the type-related stuff.

Define them after we include <inttypes.h>, so that if it's defined them,
we don't redefine them.

pcap-types.h
portability.h

index bb264c3e0bee01638edffe08e48a48bd3173eb15..f1ec44841717ed14a445e22701b95feb8ac26559 100644 (file)
       #endif
     #endif
   #endif
+
+  /*
+   * These may 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.
+   *
+   * XXX - we currently aren't using any of these, but this allows
+   * their use in the future.
+   */
+  #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
 #elif defined(__MINGW32__)
   /*
    * Target is Windows, compiler is MinGW.
index 0a21537be96e6b73f57190681408a3ec52dcc254..21445bd54d94c0bd726b0b9e0f9cb5099d496731 100644 (file)
@@ -169,50 +169,6 @@ extern int pcap_vsnprintf(char *, size_t, const char *, va_list ap);
 #endif /* HAVE_STRTOK_R */
 
 #ifdef _WIN32
-  /*
-   * These may 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.
-   *
-   * XXX - we currently aren't using any of these, but this allows
-   * their use in the future.
-   */
-  #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
-
   #if !defined(__cplusplus)
     #define inline __inline
   #endif