Fix Windows build without pcap.
authorGuy Harris <guy@alum.mit.edu>
Fri, 12 May 2017 18:43:09 +0000 (11:43 -0700)
committerGuy Harris <guy@alum.mit.edu>
Fri, 12 May 2017 18:44:10 +0000 (18:44 +0000)
Change-Id: Ib79da01124a7f1b44f168ce19691d3ceaa7d5a68
Reviewed-on: https://code.wireshark.org/review/21619
Reviewed-by: Guy Harris <guy@alum.mit.edu>
tshark.c

index 4e4cb18306caf8ea34c4ce5da071779ea2aa2090..e4d4551c9603bcaf62d4c96161fbcb784cf9c302 100644 (file)
--- a/tshark.c
+++ b/tshark.c
 
 #include <errno.h>
 
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
+
 #ifndef _WIN32
 #include <signal.h>
 #endif
@@ -753,6 +757,7 @@ main(int argc, char *argv[])
 
 #ifdef _WIN32
   ws_init_dll_search_path();
+#ifdef HAVE_LIBPCAP
   /* Load wpcap if possible. Do this before collecting the run-time version information */
   load_wpcap();
 
@@ -761,7 +766,8 @@ main(int argc, char *argv[])
     fprintf(stderr, "The NPF driver isn't running.  You may have trouble "
       "capturing or\nlisting interfaces.\n");
   }
-#endif
+#endif /* HAVE_LIBPCAP */
+#endif /* _WIN32 */
 
   /* Get the compile-time version information string */
   comp_info_str = get_compiled_version_info(get_tshark_compiled_version_info,