From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: spawn: Fix compilation error on macOS
Date: Sat, 04 Feb 2023 08:44:38 +0100 [thread overview]
Message-ID: <4690620.4QiuDXzJWs@nimes> (raw)
On macOS 12.5, in a testdir for module 'execute', I'm seeing these
compilation errors:
In file included from ../../gllib/execute.c:71:
./spawn.h:692:19: error: use of undeclared identifier 'POSIX_SPAWN_SETSCHEDPARAM'
| POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
^
./spawn.h:692:47: error: use of undeclared identifier 'POSIX_SPAWN_SETSCHEDULER'
| POSIX_SPAWN_SETSCHEDPARAM | POSIX_SPAWN_SETSCHEDULER)
^
This patch fixes them.
2023-02-04 Bruno Haible <bruno@clisp.org>
spawn: Fix compilation error on macOS (regression 2023-01-22).
* lib/spawn.in.h: Tweak logic for defining the POSIX_SPAWN_* constants.
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
reply other threads:[~2023-02-04 7:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4690620.4QiuDXzJWs@nimes \
--to=bruno@clisp.org \
--cc=bug-gnulib@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).