From 244389699ed7f7c3429967db56eaa60d82fa35de Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 28 Jul 2021 14:00:37 +0200 Subject: [PATCH 1/3] Drop checks for pid_t from autoconf and CMake This type should always be defined in sys/types.h on any non-ancient Unix system, so don't bother checking for it, which is not only wasteful but can even be harmful because it can conflict with pid_t definitions in the other libraries under Windows, where we (wrongly) define it as int (which is actually a bug in autoconf, which was recently fixed, see https://savannah.gnu.org/support/index.php?110296) when using CMake. So just don't define it at all: it should be already defined under Unix and we don't use it under MSW anyhow. See https://github.com/microsoft/vcpkg/issues/19110 See #18150. --- build/cmake/setup.cmake | 2 +- build/cmake/setup.h.in | 3 --- configure | 11 ----------- configure.in | 2 -- setup.h.in | 3 --- setup.h_vms | 3 --- 6 files changed, 1 insertion(+), 23 deletions(-) diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index 45097e02d9..5c41065187 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -648,7 +648,7 @@ endif() # Check size and availability of various types set(SYSTYPES - pid_t size_t + size_t wchar_t int long short gid_t uid_t ) diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index b400d2eda9..bf6037b0cb 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -26,9 +26,6 @@ /* Define to `long' if doesn't define. */ #cmakedefine off_t long -/* Define to `int' if doesn't define. */ -#cmakedefine pid_t int - /* Define to `unsigned' if doesn't define. */ #cmakedefine size_t unsigned diff --git a/configure b/configure index 107a4e5fd1..26f5bf4f5f 100755 --- a/configure +++ b/configure @@ -29757,17 +29757,6 @@ _ACEOF fi -ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" -if test "x$ac_cv_type_pid_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define pid_t int -_ACEOF - -fi - ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : diff --git a/configure.in b/configure.in index 57a7ba4610..e28342bafb 100644 --- a/configure.in +++ b/configure.in @@ -4088,8 +4088,6 @@ dnl defines mode_t if not already defined AC_TYPE_MODE_T dnl defines off_t if not already defined AC_TYPE_OFF_T -dnl defines pid_t if not already defined -AC_TYPE_PID_T dnl defines size_t if not already defined AC_TYPE_SIZE_T diff --git a/setup.h.in b/setup.h.in index 9ca552a4ce..53768487bb 100644 --- a/setup.h.in +++ b/setup.h.in @@ -26,9 +26,6 @@ /* Define to `long' if doesn't define. */ #undef off_t -/* Define to `int' if doesn't define. */ -#undef pid_t - /* Define to `unsigned' if doesn't define. */ #undef size_t diff --git a/setup.h_vms b/setup.h_vms index 261a3ea2c6..c9ebf676ff 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -45,9 +45,6 @@ /* Define to `long' if doesn't define. */ #undef off_t -/* Define to `int' if doesn't define. */ -#undef pid_t - /* Define to `unsigned' if doesn't define. */ #undef size_t From e8975eec72b975a0132f49878885c024248ac4b0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 28 Jul 2021 20:59:55 +0200 Subject: [PATCH 2/3] Stop testing for gid_t and uid_t that we never use in CMake Also remove the corresponding parts of setup.h.in. --- build/cmake/setup.cmake | 1 - build/cmake/setup.h.in | 6 ------ setup.h.in | 6 ------ setup.h_vms | 6 ------ 4 files changed, 19 deletions(-) diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index 5c41065187..972f37fbb7 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -650,7 +650,6 @@ endif() set(SYSTYPES size_t wchar_t int long short - gid_t uid_t ) if(NOT MSVC) list(APPEND SYSTYPES mode_t off_t) diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index bf6037b0cb..7601b511a2 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -17,9 +17,6 @@ /* the installation location prefix from configure */ #cmakedefine wxINSTALL_PREFIX "@wxINSTALL_PREFIX@" -/* Define to `int' if doesn't define. */ -#cmakedefine gid_t int - /* Define to `int' if doesn't define. */ #cmakedefine mode_t int @@ -40,9 +37,6 @@ #cmakedefine _GNU_SOURCE 1 #endif -/* Define to `int' if doesn't define. */ -#cmakedefine uid_t int - /* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #cmakedefine WORDS_BIGENDIAN 1 diff --git a/setup.h.in b/setup.h.in index 53768487bb..ea18824f28 100644 --- a/setup.h.in +++ b/setup.h.in @@ -17,9 +17,6 @@ /* the installation location prefix from configure */ #undef wxINSTALL_PREFIX -/* Define to `int' if doesn't define. */ -#undef gid_t - /* Define to `int' if doesn't define. */ #undef mode_t @@ -40,9 +37,6 @@ #undef _GNU_SOURCE #endif -/* Define to `int' if doesn't define. */ -#undef uid_t - /* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN diff --git a/setup.h_vms b/setup.h_vms index c9ebf676ff..5e547653c5 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -36,9 +36,6 @@ /* Define this to get extra features from GNU libc. */ #undef _GNU_SOURCE -/* Define to `int' if doesn't define. */ -#undef gid_t - /* Define to `int' if doesn't define. */ #undef mode_t @@ -54,9 +51,6 @@ /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* Define to `int' if doesn't define. */ -#undef uid_t - /* Define if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN From 32d9b0413d572d2d6f6e310275d15d467fd862f1 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 28 Jul 2021 21:09:32 +0200 Subject: [PATCH 3/3] Don't bother checking for size_t, mode_t and off_t neither The latter two are always defined in sys/types.h on all Unix systems and we already define them for MSVC (which doesn't use configure anyhow). The former type is always defined everywhere. --- build/cmake/setup.cmake | 10 ++-------- build/cmake/setup.h.in | 9 --------- configure | 34 ---------------------------------- configure.in | 7 ------- setup.h.in | 9 --------- setup.h_vms | 9 --------- 6 files changed, 2 insertions(+), 76 deletions(-) diff --git a/build/cmake/setup.cmake b/build/cmake/setup.cmake index 972f37fbb7..d294178203 100644 --- a/build/cmake/setup.cmake +++ b/build/cmake/setup.cmake @@ -646,14 +646,8 @@ if(wxUSE_XLOCALE) set(CMAKE_EXTRA_INCLUDE_FILES) endif() -# Check size and availability of various types -set(SYSTYPES - size_t - wchar_t int long short - ) -if(NOT MSVC) - list(APPEND SYSTYPES mode_t off_t) -endif() +# Check sizes of various types +set(SYSTYPES size_t wchar_t int long short) foreach(SYSTYPE ${SYSTYPES}) string(TOUPPER ${SYSTYPE} SYSTYPE_UPPER) diff --git a/build/cmake/setup.h.in b/build/cmake/setup.h.in index 7601b511a2..d91c0811e2 100644 --- a/build/cmake/setup.h.in +++ b/build/cmake/setup.h.in @@ -17,15 +17,6 @@ /* the installation location prefix from configure */ #cmakedefine wxINSTALL_PREFIX "@wxINSTALL_PREFIX@" -/* Define to `int' if doesn't define. */ -#cmakedefine mode_t int - -/* Define to `long' if doesn't define. */ -#cmakedefine off_t long - -/* Define to `unsigned' if doesn't define. */ -#cmakedefine size_t unsigned - /* Define if ssize_t type is available. */ #cmakedefine HAVE_SSIZE_T diff --git a/configure b/configure index 26f5bf4f5f..e76a56a6e1 100755 --- a/configure +++ b/configure @@ -29735,40 +29735,6 @@ WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_u -ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" -if test "x$ac_cv_type_mode_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define mode_t int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" -if test "x$ac_cv_type_off_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define off_t long int -_ACEOF - -fi - -ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" -if test "x$ac_cv_type_size_t" = xyes; then : - -else - -cat >>confdefs.h <<_ACEOF -#define size_t unsigned int -_ACEOF - -fi - - ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : diff --git a/configure.in b/configure.in index e28342bafb..12cae2fd01 100644 --- a/configure.in +++ b/configure.in @@ -4084,13 +4084,6 @@ dnl --------------------------------------------------------------------------- dnl Checks for typedefs dnl --------------------------------------------------------------------------- -dnl defines mode_t if not already defined -AC_TYPE_MODE_T -dnl defines off_t if not already defined -AC_TYPE_OFF_T -dnl defines size_t if not already defined -AC_TYPE_SIZE_T - dnl sets HAVE_SSIZE_T if ssize_t is defined AC_CHECK_TYPES(ssize_t) diff --git a/setup.h.in b/setup.h.in index ea18824f28..75c02fb407 100644 --- a/setup.h.in +++ b/setup.h.in @@ -17,15 +17,6 @@ /* the installation location prefix from configure */ #undef wxINSTALL_PREFIX -/* Define to `int' if doesn't define. */ -#undef mode_t - -/* Define to `long' if doesn't define. */ -#undef off_t - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - /* Define if ssize_t type is available. */ #undef HAVE_SSIZE_T diff --git a/setup.h_vms b/setup.h_vms index 5e547653c5..aa63876e8e 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -36,15 +36,6 @@ /* Define this to get extra features from GNU libc. */ #undef _GNU_SOURCE -/* Define to `int' if doesn't define. */ -#undef mode_t - -/* Define to `long' if doesn't define. */ -#undef off_t - -/* Define to `unsigned' if doesn't define. */ -#undef size_t - /* Define if ssize_t type is available. */ #define HAVE_SSIZE_T 1