From: Guy Harris Date: Wed, 16 May 2018 19:51:45 +0000 (-0700) Subject: Eliminate some unneeded header checks. X-Git-Url: http://git.samba.org/?p=metze%2Fwireshark%2Fwip.git;a=commitdiff_plain;h=d08d0a87c5dd20d8626649693a81279415f47c22 Eliminate some unneeded header checks. sys/stat.h and sys/types.h date back to V7 UNIX, so they should be present on all UN*Xes, and we're assuming they're available on Windows, so, unless and until we ever support platforms that are neither UN*Xes nor Windows, we don't need to check for them. Remove the CMake checks for them, remove the HAVE_ values from cmakeconfig.h.in, and remove all tests for the HAVE_ values. Change-Id: I90bb2aab37958553673b03b52f4931d3b304b9d0 Reviewed-on: https://code.wireshark.org/review/27603 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5dcdceecd2..6a38731a49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,7 +127,6 @@ if(WIN32) # Prepopulate some ConfigureChecks values. Compilation checks # on Windows can be slow. set(HAVE_FCNTL_H TRUE) - set(HAVE_SYS_STAT_H TRUE) set(HAVE_FLOORL TRUE) set(HAVE_LRINT TRUE) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 8fdae65ad8..f6bf312b66 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -23,9 +23,7 @@ check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H) check_include_file("sys/select.h" HAVE_SYS_SELECT_H) check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H) check_include_file("sys/sockio.h" HAVE_SYS_SOCKIO_H) -check_include_file("sys/stat.h" HAVE_SYS_STAT_H) check_include_file("sys/time.h" HAVE_SYS_TIME_H) -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) diff --git a/capture_opts.h b/capture_opts.h index 6e193cf6e3..9bbd3e8599 100644 --- a/capture_opts.h +++ b/capture_opts.h @@ -18,9 +18,7 @@ #ifndef __CAPTURE_OPTS_H__ #define __CAPTURE_OPTS_H__ -#ifdef HAVE_SYS_TYPES_H -# include /* for gid_t */ -#endif +#include /* for gid_t */ #include diff --git a/caputils/capture-pcap-util.c b/caputils/capture-pcap-util.c index 2bc772068b..e2fa5c26b7 100644 --- a/caputils/capture-pcap-util.c +++ b/caputils/capture-pcap-util.c @@ -19,9 +19,7 @@ #include #include -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include #ifdef HAVE_SYS_SOCKET_H #include diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in index 57d7d59db1..360e0648fe 100644 --- a/cmakeconfig.h.in +++ b/cmakeconfig.h.in @@ -309,15 +309,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_SOCKIO_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_STAT_H 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_TIME_H 1 -/* Define to 1 if you have the header file. */ -#cmakedefine HAVE_SYS_TYPES_H 1 - /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SYS_UTSNAME_H 1 diff --git a/dumpcap.c b/dumpcap.c index 5d922d1385..3b5592cd8b 100644 --- a/dumpcap.c +++ b/dumpcap.c @@ -15,9 +15,7 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include #ifdef HAVE_SYS_SOCKET_H #include diff --git a/epan/tap.c b/epan/tap.c index b431498fb0..5442a159ad 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -12,9 +12,7 @@ #include -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include #ifdef HAVE_NETINET_IN_H # include diff --git a/extcap.c b/extcap.c index f9a24573b6..76ae8b9104 100644 --- a/extcap.c +++ b/extcap.c @@ -25,9 +25,7 @@ #include #endif -#ifdef HAVE_SYS_TYPES_H #include -#endif #ifdef HAVE_SYS_WAIT_H #include #endif diff --git a/file.c b/file.c index c9b9878f81..3e391cf6e0 100644 --- a/file.c +++ b/file.c @@ -54,9 +54,7 @@ #include "ui/ws_ui_util.h" /* Needed for addrinfo */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include #ifdef HAVE_SYS_SOCKET_H #include diff --git a/ui/qt/interface_toolbar_reader.cpp b/ui/qt/interface_toolbar_reader.cpp index 6a2fc745e4..d17899772b 100644 --- a/ui/qt/interface_toolbar_reader.cpp +++ b/ui/qt/interface_toolbar_reader.cpp @@ -9,9 +9,7 @@ #include "config.h" -#ifdef HAVE_SYS_TYPES_H #include -#endif #ifdef HAVE_UNISTD_H #include diff --git a/wiretap/mime_file.c b/wiretap/mime_file.c index 7a47695f47..021f27a5e7 100644 --- a/wiretap/mime_file.c +++ b/wiretap/mime_file.c @@ -18,9 +18,7 @@ #include "config.h" -#ifdef HAVE_SYS_TYPES_H #include -#endif #ifdef HAVE_UNISTD_H #include diff --git a/wiretap/mp2t.c b/wiretap/mp2t.c index 5d01b8f2e9..d374be8beb 100644 --- a/wiretap/mp2t.c +++ b/wiretap/mp2t.c @@ -10,9 +10,7 @@ #include "config.h" -#ifdef HAVE_SYS_TYPES_H #include -#endif #ifdef HAVE_UNISTD_H #include diff --git a/wiretap/mpeg.c b/wiretap/mpeg.c index ed14e44615..2e2c47556d 100644 --- a/wiretap/mpeg.c +++ b/wiretap/mpeg.c @@ -10,9 +10,7 @@ #include "config.h" -#ifdef HAVE_SYS_TYPES_H #include -#endif #ifdef HAVE_UNISTD_H #include diff --git a/wiretap/nettrace_3gpp_32_423.c b/wiretap/nettrace_3gpp_32_423.c index 4d72caeaf7..61c60e9add 100644 --- a/wiretap/nettrace_3gpp_32_423.c +++ b/wiretap/nettrace_3gpp_32_423.c @@ -10,9 +10,7 @@ #include "config.h" -#ifdef HAVE_SYS_TYPES_H #include -#endif #ifdef HAVE_UNISTD_H #include diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 2853923a72..7e55135e47 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -11,9 +11,7 @@ #include #include -#ifdef HAVE_SYS_TYPES_H #include -#endif #include "wtap-int.h" #include "wtap_opttypes.h" diff --git a/wsutil/file_util.h b/wsutil/file_util.h index fe2f7ba118..0f88eab746 100644 --- a/wsutil/file_util.h +++ b/wsutil/file_util.h @@ -32,9 +32,7 @@ extern "C" { #include /* for read(), write(), close(), etc. */ #endif -#ifdef HAVE_SYS_STAT_H #include /* for stat() and struct stat */ -#endif /* * Visual C++ on Win32 systems doesn't define these. (Old UNIX systems don't diff --git a/wsutil/inet_addr.c b/wsutil/inet_addr.c index 8f047721a7..e133b57834 100644 --- a/wsutil/inet_addr.c +++ b/wsutil/inet_addr.c @@ -17,9 +17,7 @@ #include #endif -#ifdef HAVE_SYS_TYPES_H #include -#endif #ifdef HAVE_SYS_SOCKET_H #include /* needed to define AF_ values on UNIX */ diff --git a/wsutil/interface.c b/wsutil/interface.c index 0d9b282d00..98344d3437 100644 --- a/wsutil/interface.c +++ b/wsutil/interface.c @@ -17,9 +17,7 @@ #include #include -#ifdef HAVE_SYS_TYPES_H - #include -#endif +#include #ifdef HAVE_SYS_SOCKET_H #include diff --git a/wsutil/privileges.c b/wsutil/privileges.c index e1fef22026..7166b46c58 100644 --- a/wsutil/privileges.c +++ b/wsutil/privileges.c @@ -98,9 +98,7 @@ get_cur_groupname(void) { #else /* _WIN32 */ -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include #ifdef HAVE_UNISTD_H #include