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.
This commit is contained in:
Vadim Zeitlin
2021-07-28 14:00:37 +02:00
parent e947508da4
commit 244389699e
6 changed files with 1 additions and 23 deletions

View File

@@ -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
)

View File

@@ -26,9 +26,6 @@
/* Define to `long' if <sys/types.h> doesn't define. */
#cmakedefine off_t long
/* Define to `int' if <sys/types.h> doesn't define. */
#cmakedefine pid_t int
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#cmakedefine size_t unsigned

11
configure vendored
View File

@@ -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 :

View File

@@ -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

View File

@@ -26,9 +26,6 @@
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t

View File

@@ -45,9 +45,6 @@
/* Define to `long' if <sys/types.h> doesn't define. */
#undef off_t
/* Define to `int' if <sys/types.h> doesn't define. */
#undef pid_t
/* Define to `unsigned' if <sys/types.h> doesn't define. */
#undef size_t