From 2daa8e1355298bd08efd78e23fce57cd0c14ece1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 4 Feb 2023 08:43:50 +0100 Subject: [PATCH] spawn: Fix compilation error on macOS (regression 2023-01-22). * lib/spawn.in.h: Tweak logic for defining the POSIX_SPAWN_* constants. --- ChangeLog | 5 +++++ lib/spawn.in.h | 17 ++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62010f67e6..fe9bdb27a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2023-02-04 Bruno Haible + + spawn: Fix compilation error on macOS (regression 2023-01-22). + * lib/spawn.in.h: Tweak logic for defining the POSIX_SPAWN_* constants. + 2023-02-03 Bruno Haible relocatable-prog: Fix compiler warning. diff --git a/lib/spawn.in.h b/lib/spawn.in.h index 958464a7d2..b35e5d77b3 100644 --- a/lib/spawn.in.h +++ b/lib/spawn.in.h @@ -144,19 +144,18 @@ typedef struct /* Flags to be set in the 'posix_spawnattr_t'. */ #if @HAVE_POSIX_SPAWN@ -# if !@REPLACE_POSIX_SPAWN@ -/* Use the values from the system, but provide the missing ones. */ -# ifndef POSIX_SPAWN_SETSCHEDPARAM -# define POSIX_SPAWN_SETSCHEDPARAM 0 -# endif -# ifndef POSIX_SPAWN_SETSCHEDULER -# define POSIX_SPAWN_SETSCHEDULER 0 -# endif -# else /* @REPLACE_POSIX_SPAWN@ */ +# if @REPLACE_POSIX_SPAWN@ /* Use the values from the system, for better compatibility. */ /* But this implementation does not support AIX extensions. */ # undef POSIX_SPAWN_FORK_HANDLERS # endif +/* Provide the values that the system is lacking. */ +# ifndef POSIX_SPAWN_SETSCHEDPARAM +# define POSIX_SPAWN_SETSCHEDPARAM 0 +# endif +# ifndef POSIX_SPAWN_SETSCHEDULER +# define POSIX_SPAWN_SETSCHEDULER 0 +# endif #else /* !@HAVE_POSIX_SPAWN@ */ # define POSIX_SPAWN_RESETIDS 0x01 # define POSIX_SPAWN_SETPGROUP 0x02 -- 2.39.5