]> The Tcpdump Group git mirrors - libpcap/commitdiff
Move the definition of strdup to portability.h.
authorGuy Harris <[email protected]>
Fri, 29 Jul 2016 04:40:12 +0000 (21:40 -0700)
committerGuy Harris <[email protected]>
Fri, 29 Jul 2016 04:40:12 +0000 (21:40 -0700)
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.

pcap-stdinc.h
portability.h

index d72ba334c2c1732300c05dc049bb2d9b897beee4..07f512e40dcc623a34b46c040f4c15628212fae2 100644 (file)
   #endif
 #endif
 
-#ifdef _MSC_VER
-  #define strdup    _strdup
-#endif
-
 #if !defined(__cplusplus)
   #define inline __inline
 #endif
index 536abdfcf5ecfa12e453b95ef9ca2d06b3339198..5a35b3619fa5e0de9fb9b5c68d5546be3f84e203 100644 (file)
@@ -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