]> The Tcpdump Group git mirrors - libpcap/commitdiff
In MSVC debug-mode ('-MDd' or '-MTd'), there is an important warning on
authorGisle Vanem <[email protected]>
Thu, 16 Mar 2017 11:07:02 +0000 (11:07 +0000)
committerGisle Vanem <[email protected]>
Thu, 16 Mar 2017 11:07:02 +0000 (11:07 +0000)
the redefinion of 'strdup':
  portability.h(104): warning C4005: 'strdup': macro redefinition
  f:\ProgramFiler-x86\WindowsKits\Include\10.0.10586.0\ucrt\crtdbg.h(319):
    note: see previous definition of 'strdup'

It's definition is:
  #define strdup(s)  _strdup_dbg(s, _NORMAL_BLOCK, __FILE__, __LINE__)

Undoing that in "portability.h" would defeat the purpose of '_DEBUG' mode.

portability.h

index ce075500ed4e5329dde5b58f742b280b2a671158..f050ffa2720de4fee2343f353f22d0d790bf9500 100644 (file)
@@ -100,7 +100,9 @@ extern "C" {
 #endif
 
 #ifdef _MSC_VER
+  #ifndef _DEBUG
   #define strdup       _strdup
+  #endif
   #define sscanf       sscanf_s
   #define setbuf(x, y) \
        setvbuf((x), (y), _IONBF, 0)