>From efe32f6a916b6addcfe60d2283cef4cebc6177ff Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 24 Aug 2020 01:19:18 +0200 Subject: [PATCH 1/2] sys_types: Fix definition of pid_t on 64-bit MSVC. * m4/pid_t.m4: New file. * modules/sys_types (Files): Add it. * modules/dirent (Files): Likewise. * modules/fcntl-h (Files): Likewise. * modules/sched (Files): Likewise. * modules/signal-h (Files): Likewise. * modules/spawn (Files): Likewise. * modules/sys_stat (Files): Likewise. * modules/sys_wait (Files): Likewise. * modules/termios (Files): Likewise. * modules/unistd (Files): Likewise. --- ChangeLog | 15 +++++++++++++++ m4/pid_t.m4 | 33 +++++++++++++++++++++++++++++++++ modules/dirent | 1 + modules/fcntl-h | 1 + modules/sched | 1 + modules/signal-h | 1 + modules/spawn | 1 + modules/sys_stat | 1 + modules/sys_types | 1 + modules/sys_wait | 1 + modules/termios | 1 + modules/unistd | 1 + 12 files changed, 58 insertions(+) create mode 100644 m4/pid_t.m4 diff --git a/ChangeLog b/ChangeLog index e54c89f..9c2dcdc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,20 @@ 2020-08-23 Bruno Haible + sys_types: Fix definition of pid_t on 64-bit MSVC. + * m4/pid_t.m4: New file. + * modules/sys_types (Files): Add it. + * modules/dirent (Files): Likewise. + * modules/fcntl-h (Files): Likewise. + * modules/sched (Files): Likewise. + * modules/signal-h (Files): Likewise. + * modules/spawn (Files): Likewise. + * modules/sys_stat (Files): Likewise. + * modules/sys_wait (Files): Likewise. + * modules/termios (Files): Likewise. + * modules/unistd (Files): Likewise. + +2020-08-23 Bruno Haible + inttypes: Fix {PRI,SCN}*PTR on 32-bit native Windows (regr. 2020-07-21). * m4/inttypes.m4 (gl_INTTYPES_PRI_SCN): Fix syntax error in test program. diff --git a/m4/pid_t.m4 b/m4/pid_t.m4 new file mode 100644 index 0000000..321082d --- /dev/null +++ b/m4/pid_t.m4 @@ -0,0 +1,33 @@ +# pid_t.m4 serial 1 +dnl Copyright (C) 2020 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl Define pid_t if the headers don't define it. +AC_DEFUN([AC_TYPE_PID_T], +[ + AC_CHECK_TYPE([pid_t], + [], + [dnl On 64-bit native Windows, define it to the equivalent of 'intptr_t' + dnl (= 'long long' = '__int64'), because that is the return type + dnl of the _spawnv* functions + dnl + dnl and the argument type of the _cwait function + dnl . + dnl Otherwise (on 32-bit Windows and on old Unix platforms), define it + dnl to 'int'. + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #if defined _WIN64 && !defined __CYGWIN__ + LLP64 + #endif + ]]) + ], + [gl_pid_type='int'], + [gl_pid_type='__int64']) + AC_DEFINE_UNQUOTED([pid_t], [$gl_pid_type], + [Define as a signed integer type capable of holding a process identifier.]) + ], + [AC_INCLUDES_DEFAULT]) +]) diff --git a/modules/dirent b/modules/dirent index 6f615b4..08a6326 100644 --- a/modules/dirent +++ b/modules/dirent @@ -5,6 +5,7 @@ Files: lib/dirent.in.h m4/dirent_h.m4 m4/unistd_h.m4 +m4/pid_t.m4 Depends-on: include_next diff --git a/modules/fcntl-h b/modules/fcntl-h index ff74dec..2ef0106 100644 --- a/modules/fcntl-h +++ b/modules/fcntl-h @@ -5,6 +5,7 @@ Files: lib/fcntl.in.h m4/fcntl_h.m4 m4/fcntl-o.m4 +m4/pid_t.m4 Depends-on: extensions diff --git a/modules/sched b/modules/sched index 0b6bcae..572c57b 100644 --- a/modules/sched +++ b/modules/sched @@ -4,6 +4,7 @@ A include file. Files: lib/sched.in.h m4/sched_h.m4 +m4/pid_t.m4 Depends-on: include_next diff --git a/modules/signal-h b/modules/signal-h index 810e2bf..2f38e9b 100644 --- a/modules/signal-h +++ b/modules/signal-h @@ -4,6 +4,7 @@ A GNU-like . Files: lib/signal.in.h m4/signal_h.m4 +m4/pid_t.m4 Depends-on: include_next diff --git a/modules/spawn b/modules/spawn index 6e03294..f1b99ca 100644 --- a/modules/spawn +++ b/modules/spawn @@ -4,6 +4,7 @@ A POSIX compliant . Files: lib/spawn.in.h m4/spawn_h.m4 +m4/pid_t.m4 Depends-on: include_next diff --git a/modules/sys_stat b/modules/sys_stat index af276ab..42ae932 100644 --- a/modules/sys_stat +++ b/modules/sys_stat @@ -5,6 +5,7 @@ Files: lib/sys_stat.in.h m4/sys_stat_h.m4 m4/unistd_h.m4 +m4/pid_t.m4 Depends-on: include_next diff --git a/modules/sys_types b/modules/sys_types index 81a11aa..c00862c 100644 --- a/modules/sys_types +++ b/modules/sys_types @@ -5,6 +5,7 @@ Files: lib/sys_types.in.h m4/sys_types_h.m4 m4/off_t.m4 +m4/pid_t.m4 Depends-on: include_next diff --git a/modules/sys_wait b/modules/sys_wait index bedd7e1..73ce50b 100644 --- a/modules/sys_wait +++ b/modules/sys_wait @@ -4,6 +4,7 @@ A for systems with missing declarations. Files: lib/sys_wait.in.h m4/sys_wait_h.m4 +m4/pid_t.m4 Depends-on: include_next diff --git a/modules/termios b/modules/termios index 88056cc..8cb73e4 100644 --- a/modules/termios +++ b/modules/termios @@ -4,6 +4,7 @@ A that works around platform issues. Files: lib/termios.in.h m4/termios_h.m4 +m4/pid_t.m4 Depends-on: include_next diff --git a/modules/unistd b/modules/unistd index b14faaa..18b91c4 100644 --- a/modules/unistd +++ b/modules/unistd @@ -6,6 +6,7 @@ m4/unistd_h.m4 lib/unistd.c lib/unistd.in.h m4/off_t.m4 +m4/pid_t.m4 Depends-on: extern-inline -- 2.7.4