X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/64ab4a9e04c8f92871a9c3a89b91ddf3498741c3..40f1cf8aa72185cce0994aaaf8b14d524e5a4d8b:/netdissect-stdinc.h diff --git a/netdissect-stdinc.h b/netdissect-stdinc.h index 5aef8234..9cf3cf07 100644 --- a/netdissect-stdinc.h +++ b/netdissect-stdinc.h @@ -148,12 +148,23 @@ #define PRIu64 "llu" #endif #endif + + /* + * MSVC's support library doesn't support %zu to print a size_t until + * Visual Studio 2017, but supports %Iu earlier, so use that. + */ + #define PRIsize "Iu" #elif defined(__MINGW32__) || !defined(_WIN32) /* * Compiler is MinGW or target is UN*X or MS-DOS. Just use * . */ #include + + /* + * Assume the support library supports %zu; it's required by C99. + */ + #define PRIsize "zu" #endif #endif /* HAVE_PCAP_PCAP_INTTYPES_H */