From: Guy Harris Date: Fri, 29 Jul 2016 04:40:12 +0000 (-0700) Subject: Move the definition of strdup to portability.h. X-Git-Tag: libpcap-1.8.1~120 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/4ab1b77f9593330e0861ba908d4deb8959461b19 Move the definition of strdup to portability.h. That way, code such as sockutils.c that doesn't include any pcap header files (because it doesn't use pcap) can still get it defined. --- diff --git a/pcap-stdinc.h b/pcap-stdinc.h index d72ba334..07f512e4 100644 --- a/pcap-stdinc.h +++ b/pcap-stdinc.h @@ -172,10 +172,6 @@ #endif #endif -#ifdef _MSC_VER - #define strdup _strdup -#endif - #if !defined(__cplusplus) #define inline __inline #endif diff --git a/portability.h b/portability.h index 536abdfc..5a35b361 100644 --- a/portability.h +++ b/portability.h @@ -77,6 +77,10 @@ extern "C" { #define FORMAT_STRING(p) p #endif +#ifdef _MSC_VER + #define strdup _strdup +#endif + /* * On Windows, snprintf(), with that name and with C99 behavior - i.e., * guaranteeing that the formatted string is null-terminated - didn't