Wireshark-dev: [Wireshark-dev] capture_win_ifnames.c compile fails if config.h is included ??
From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Mon, 19 Nov 2012 21:49:12 -0500
The recently added file 'capture_win_ifnames.c' fails to compile if config.h is included.

After a bit of poking around, I found that (one or both of) 2 defines in config.h (shown below) cause the problem. (That is: 'capture_win_ifnames.c' compiles OK if the two defines are commented out.

However, these two defines are apparently needed for other wireshark
sources to compile without error (e.g., addr_resolv.c)

Does anyone know how to fix things ? (I'm assuming that config.h really should be included in capture_win_ifnames.c).

1. capture_win_ifnames.c compile error (with unchanged config.h
   included:

capture_win_ifnames.c(98) : error C2065: 'NDIS_IF_MAX_STRING_SIZE' : undeclared identifier
...

(Note: This problem didn't show previously because the
#include <config.h> was wrapped in #ifdef HAVE_CONFIG_H
and HAVE_CONFIG_H is no longer defined since use of same
was recently removed).

2. addr_resolv.c compile error if the two defines in
   config.h are commented out:

Microsoft SDKs\Windows\v7.0A\include\ws2tcpip.h(499) : error C2373: 'ws_inet_pton' : redefinition; different type modifiers


3. (As originally added by Ulf)

------------------------------------------------------------------------
r23691 | ulfl | 2007-11-30 17:01:05 -0500 (Fri, 30 Nov 2007) | 1 line

first steps to support MSVC 2008 Express Edition
------------------------------------------------------------------------


+++ trunk/config.h.win32        (revision 23691)
...
+/* Visual C 9 (2008) now needs these prototypes */
+#if _MSC_VER == 1500
+#define NTDDI_VERSION NTDDI_WIN2K
+#define _WIN32_WINNT _WIN32_WINNT_WIN2K
+#endif
...

(Note: the current config.h.win32 is the same as this except that the test is for VC9 or VC10 or VC11).


Bill