From bfad9c56f9e65eafba00f97e5e649842782eb2e1 Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Wed, 25 Oct 2017 17:42:15 -0700 Subject: [PATCH] CMake: Don't check for windows.h or winsock2.h. If we're building on Windows we're going to have windows.h and winsock2.h. Don't bother checking for them. Change-Id: I0004c44d7364ab3f41682f34b8c84cd8617c9603 Reviewed-on: https://code.wireshark.org/review/24068 Reviewed-by: Gerald Combs Petri-Dish: Gerald Combs Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- ConfigureChecks.cmake | 2 -- caputils/airpcap.h | 2 +- cmakeconfig.h.in | 6 ------ editcap.c | 2 -- epan/addr_resolv.c | 7 ++----- epan/dissectors/packet-lbm.h | 2 +- file.c | 5 +---- tshark.c | 2 +- ui/tap-sctp-analysis.h | 2 -- ui/util.c | 2 +- wiretap/wtap-int.h | 2 +- wsutil/socket.h | 11 ++--------- wsutil/tempfile.c | 5 +---- 13 files changed, 11 insertions(+), 39 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index bdbd6329b5..4630e6ba39 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -51,8 +51,6 @@ check_include_file("sys/types.h" HAVE_SYS_TYPES_H) check_include_file("sys/utsname.h" HAVE_SYS_UTSNAME_H) check_include_file("sys/wait.h" HAVE_SYS_WAIT_H) check_include_file("unistd.h" HAVE_UNISTD_H) -check_include_file("windows.h" HAVE_WINDOWS_H) -check_include_file("winsock2.h" HAVE_WINSOCK2_H) # # On Linux, check for some additional headers, which we need as a diff --git a/caputils/airpcap.h b/caputils/airpcap.h index dcef9388ea..f11e6a1478 100644 --- a/caputils/airpcap.h +++ b/caputils/airpcap.h @@ -27,7 +27,7 @@ #pragma warning( disable : 4996) #endif -#ifdef HAVE_WINSOCK2_H +#ifdef _WIN32 #include #endif diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index fe5491cc08..994411a6a7 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -363,12 +363,6 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_UNISTD_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_WINDOWS_H 1 - -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_WINSOCK2_H 1 - /* Name of package */ #cmakedefine PACKAGE diff --git a/editcap.c b/editcap.c index a9af646846..77e0c36d63 100644 --- a/editcap.c +++ b/editcap.c @@ -66,10 +66,8 @@ #ifdef _WIN32 #include #include /* getpid */ -#ifdef HAVE_WINSOCK2_H #include #endif -#endif #ifndef HAVE_STRPTIME # include "wsutil/strptime.h" diff --git a/epan/addr_resolv.c b/epan/addr_resolv.c index 3f3ef5ad31..df7a7ff015 100644 --- a/epan/addr_resolv.c +++ b/epan/addr_resolv.c @@ -76,12 +76,9 @@ #include /* needed to define AF_ values on UNIX */ #endif -#ifdef HAVE_WINSOCK2_H -#include /* needed to define AF_ values on Windows */ -#endif - #ifdef _WIN32 -# include +#include /* needed to define AF_ values on Windows */ +#include #endif #ifdef HAVE_C_ARES diff --git a/epan/dissectors/packet-lbm.h b/epan/dissectors/packet-lbm.h index 8772b0509a..4eee77ae21 100644 --- a/epan/dissectors/packet-lbm.h +++ b/epan/dissectors/packet-lbm.h @@ -98,7 +98,7 @@ # include #endif -#ifdef HAVE_WINSOCK2_H +#ifdef _WIN32 #include #endif diff --git a/file.c b/file.c index 0ea3e90000..597f695a11 100644 --- a/file.c +++ b/file.c @@ -83,11 +83,8 @@ # include #endif -#ifdef HAVE_WINSOCK2_H -# include -#endif - #ifdef _WIN32 +# include # include #endif diff --git a/tshark.c b/tshark.c index cbae439fd8..4b56e2f2c2 100644 --- a/tshark.c +++ b/tshark.c @@ -36,7 +36,7 @@ #include -#ifdef HAVE_WINSOCK2_H +#ifdef _WIN32 # include #endif diff --git a/ui/tap-sctp-analysis.h b/ui/tap-sctp-analysis.h index 7e007db4a0..b5d5f1542a 100644 --- a/ui/tap-sctp-analysis.h +++ b/ui/tap-sctp-analysis.h @@ -34,10 +34,8 @@ extern "C" { #include #include #else -#ifdef HAVE_WINSOCK2_H #include #endif -#endif #define CHUNK_TYPE_LENGTH 1 #define CHUNK_FLAGS_LENGTH 1 diff --git a/ui/util.c b/ui/util.c index 907f778f39..edc651a845 100644 --- a/ui/util.c +++ b/ui/util.c @@ -32,7 +32,7 @@ #include #endif -#ifdef HAVE_WINDOWS_H +#ifdef _WIN32 #include #endif diff --git a/wiretap/wtap-int.h b/wiretap/wtap-int.h index 6f03457fe5..01d697b7ac 100644 --- a/wiretap/wtap-int.h +++ b/wiretap/wtap-int.h @@ -24,7 +24,7 @@ #include #include -#ifdef HAVE_WINSOCK2_H +#ifdef _WIN32 #include #endif diff --git a/wsutil/socket.h b/wsutil/socket.h index 372cd2f793..4c5a9fe95c 100644 --- a/wsutil/socket.h +++ b/wsutil/socket.h @@ -25,16 +25,9 @@ #define __SOCKET_H__ #if defined(_WIN32) && !defined(__CYGWIN__) - #ifdef HAVE_WINDOWS_H - #include - #endif - + #include #include - - #ifdef HAVE_WINSOCK2_H - #include - #endif - + #include #include #define socket_handle_t SOCKET diff --git a/wsutil/tempfile.c b/wsutil/tempfile.c index 8e1f8dc588..62b4219f10 100644 --- a/wsutil/tempfile.c +++ b/wsutil/tempfile.c @@ -26,11 +26,8 @@ #include #include -#ifdef HAVE_WINDOWS_H -#include -#endif - #ifdef _WIN32 +#include #include /* For getpid() */ #endif