Eliminate some unneeded header checks.
authorGuy Harris <guy@alum.mit.edu>
Wed, 16 May 2018 19:51:45 +0000 (12:51 -0700)
committerGuy Harris <guy@alum.mit.edu>
Wed, 16 May 2018 22:03:09 +0000 (22:03 +0000)
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 <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
19 files changed:
CMakeLists.txt
ConfigureChecks.cmake
capture_opts.h
caputils/capture-pcap-util.c
cmakeconfig.h.in
dumpcap.c
epan/tap.c
extcap.c
file.c
ui/qt/interface_toolbar_reader.cpp
wiretap/mime_file.c
wiretap/mp2t.c
wiretap/mpeg.c
wiretap/nettrace_3gpp_32_423.c
wiretap/wtap.c
wsutil/file_util.h
wsutil/inet_addr.c
wsutil/interface.c
wsutil/privileges.c

index 5dcdceecd23c29eaa8cedd95413dcd5eb20a1797..6a38731a49a60a6cd3109acda52132306ae8076b 100644 (file)
@@ -127,7 +127,6 @@ if(WIN32)
        # Prepopulate some ConfigureChecks values. Compilation checks
        # on Windows can be slow.
        set(HAVE_FCNTL_H TRUE)
        # 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)
 
        set(HAVE_FLOORL TRUE)
        set(HAVE_LRINT TRUE)
 
index 8fdae65ad850c5a231e6d85cda0889418feedb25..f6bf312b66ce72cbf7a1f3d88eb91a06af1cecd0 100644 (file)
@@ -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/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/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)
 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)
index 6e193cf6e356fe9d61cffe9a13a3636deb2ba69e..9bbd3e8599d170bece46eca8f6af5c8a50cbd4c9 100644 (file)
@@ -18,9 +18,7 @@
 #ifndef __CAPTURE_OPTS_H__
 #define __CAPTURE_OPTS_H__
 
 #ifndef __CAPTURE_OPTS_H__
 #define __CAPTURE_OPTS_H__
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>     /* for gid_t */
-#endif
+#include <sys/types.h>     /* for gid_t */
 
 #include <caputils/capture_ifinfo.h>
 
 
 #include <caputils/capture_ifinfo.h>
 
index 2bc772068bcede887488646b621051e0ac23de2e..e2fa5c26b738b7bc49e9aea4e0dcd4ea36ea6f3e 100644 (file)
@@ -19,9 +19,7 @@
 #include <limits.h>
 #include <string.h>
 
 #include <limits.h>
 #include <string.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
index 57d7d59db102ea4bc704db7646016f77890cdb4a..360e0648fe83ccd62961cddb97ba6ba29eddc27b 100644 (file)
 /* Define to 1 if you have the <sys/sockio.h> header file. */
 #cmakedefine HAVE_SYS_SOCKIO_H 1
 
 /* Define to 1 if you have the <sys/sockio.h> header file. */
 #cmakedefine HAVE_SYS_SOCKIO_H 1
 
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H 1
-
 /* Define to 1 if you have the <sys/time.h> header file. */
 #cmakedefine HAVE_SYS_TIME_H 1
 
 /* Define to 1 if you have the <sys/time.h> header file. */
 #cmakedefine HAVE_SYS_TIME_H 1
 
-/* Define to 1 if you have the <sys/types.h> header file. */
-#cmakedefine HAVE_SYS_TYPES_H 1
-
 /* Define to 1 if you have the <sys/utsname.h> header file. */
 #cmakedefine HAVE_SYS_UTSNAME_H 1
 
 /* Define to 1 if you have the <sys/utsname.h> header file. */
 #cmakedefine HAVE_SYS_UTSNAME_H 1
 
index 5d922d138506b067a11448c7c504f485229a7fe3..3b5592cd8b65a92515adeec63523b5c5bcbb2d41 100644 (file)
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -15,9 +15,7 @@
 
 #include <string.h>
 
 
 #include <string.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
index b431498fb0c965feaa8ec1eead05459b1e083430..5442a159ad213d5ded3d88e9e11e89f8691acf8d 100644 (file)
@@ -12,9 +12,7 @@
 
 #include <stdio.h>
 
 
 #include <stdio.h>
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
 
 #ifdef HAVE_NETINET_IN_H
 # include <netinet/in.h>
 
 #ifdef HAVE_NETINET_IN_H
 # include <netinet/in.h>
index f9a24573b6f644cbd4d11efe742780b4153d4eb3..76ae8b91045b702b9e531b3aad38a21adc62f996 100644 (file)
--- a/extcap.c
+++ b/extcap.c
@@ -25,9 +25,7 @@
 #include <unistd.h>
 #endif
 
 #include <unistd.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
-#endif
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
 #ifdef HAVE_SYS_WAIT_H
 #include <sys/wait.h>
 #endif
diff --git a/file.c b/file.c
index c9b9878f810d7868204be35dcd869d7242a2d4ad..3e391cf6e000b93f5646d413516e3ca32dc0e5dc 100644 (file)
--- a/file.c
+++ b/file.c
@@ -54,9 +54,7 @@
 #include "ui/ws_ui_util.h"
 
 /* Needed for addrinfo */
 #include "ui/ws_ui_util.h"
 
 /* Needed for addrinfo */
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
index 6a2fc745e4fbcb5f557ff061e396b8d5ee6bb16f..d17899772b52beae264b847ce8347ff930d1f52d 100644 (file)
@@ -9,9 +9,7 @@
 
 #include "config.h"
 
 
 #include "config.h"
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index 7a47695f47891f9ba5ac2d2f5e8fffe13148b555..021f27a5e7fec523baa4d6d60f8f150bde87cb08 100644 (file)
@@ -18,9 +18,7 @@
 
 #include "config.h"
 
 
 #include "config.h"
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index 5d01b8f2e91eaabd81b08f6a5d5e8487941758ca..d374be8beb591f412c9f050cfeeac2a708b1729f 100644 (file)
@@ -10,9 +10,7 @@
 
 #include "config.h"
 
 
 #include "config.h"
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index ed14e4461597aa3bdfbf68dd070540981789c87c..2e2c47556d6a684a1fb848e89681fe7b478aa148 100644 (file)
@@ -10,9 +10,7 @@
 
 #include "config.h"
 
 
 #include "config.h"
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index 4d72caeaf7330e8ecb8fc891f434ef73c04e1c2d..61c60e9add68f772a901df58dba4abebfcd7df94 100644 (file)
@@ -10,9 +10,7 @@
 
 #include "config.h"
 
 
 #include "config.h"
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
-#endif
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
index 2853923a7215d7f00bf15e7a96a995a0ef28b02f..7e55135e47c4d642251cde6ce4245e355b04ae9a 100644 (file)
@@ -11,9 +11,7 @@
 #include <string.h>
 #include <errno.h>
 
 #include <string.h>
 #include <errno.h>
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
-#endif
 
 #include "wtap-int.h"
 #include "wtap_opttypes.h"
 
 #include "wtap-int.h"
 #include "wtap_opttypes.h"
index fe2f7ba11852845467442a73fce592fd7951011a..0f88eab746db28b4135d692a1a5904a56e78d601 100644 (file)
@@ -32,9 +32,7 @@ extern "C" {
 #include <unistd.h>    /* for read(), write(), close(), etc. */
 #endif
 
 #include <unistd.h>    /* for read(), write(), close(), etc. */
 #endif
 
-#ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>  /* for stat() and struct stat */
 #include <sys/stat.h>  /* for stat() and struct stat */
-#endif
 
 /*
  * Visual C++ on Win32 systems doesn't define these.  (Old UNIX systems don't
 
 /*
  * Visual C++ on Win32 systems doesn't define these.  (Old UNIX systems don't
index 8f047721a7b1500c525071850f939785f1215ce4..e133b578346b863a7f30bc9f70da4862e85f23ee 100644 (file)
@@ -17,9 +17,7 @@
 #include <arpa/inet.h>
 #endif
 
 #include <arpa/inet.h>
 #endif
 
-#ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #include <sys/types.h>
-#endif
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>                /* needed to define AF_ values on UNIX */
 
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>                /* needed to define AF_ values on UNIX */
index 0d9b282d00e37e3e499badb5f2dfc4f500b8fcea..98344d343708e99c6d31dbea41df6ccbe7d3c032 100644 (file)
@@ -17,9 +17,7 @@
 #include <string.h>
 #include <wsutil/inet_addr.h>
 
 #include <string.h>
 #include <wsutil/inet_addr.h>
 
-#ifdef HAVE_SYS_TYPES_H
-       #include <sys/types.h>
-#endif
+#include <sys/types.h>
 
 #ifdef HAVE_SYS_SOCKET_H
        #include <sys/socket.h>
 
 #ifdef HAVE_SYS_SOCKET_H
        #include <sys/socket.h>
index e1fef22026945dd085f54b0ab8729d65f1a1ba1e..7166b46c581911597b33324805f17c7725e63bbe 100644 (file)
@@ -98,9 +98,7 @@ get_cur_groupname(void) {
 
 #else /* _WIN32 */
 
 
 #else /* _WIN32 */
 
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
+#include <sys/types.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>