summaryrefslogtreecommitdiff
path: root/lib/spawn.in.h
diff options
context:
space:
mode:
authorKO Myung-Hun <komh78@gmail.com>2021-01-19 01:40:07 +0900
committerBruno Haible <bruno@clisp.org>2021-01-19 18:33:28 +0100
commit6d07b345db3406425a27d565969fc04993eae98a (patch)
treefb9d30096896320f97610b8757eadb04695ef497 /lib/spawn.in.h
parent7ddc0c297211ac7a83a0a94feface10ba93c60f2 (diff)
downloadgnulib-6d07b345db3406425a27d565969fc04993eae98a.tar.gz
spawn: Use special invocation for <spawn.h> on OS/2 kLIBC.
* lib/spawn.in.h: Use special invocation to include <spawn.h> properly on OS/2 kLIBC.
Diffstat (limited to 'lib/spawn.in.h')
-rw-r--r--lib/spawn.in.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/lib/spawn.in.h b/lib/spawn.in.h
index 326b79e6c9..35e78e6cff 100644
--- a/lib/spawn.in.h
+++ b/lib/spawn.in.h
@@ -15,16 +15,33 @@
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
-#ifndef _@GUARD_PREFIX@_SPAWN_H
-
#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@
+#if defined _GL_ALREADY_INCLUDING_SPAWN_H
+/* Special invocation convention:
+ On OS/2 kLIBC, <spawn.h> includes <signal.h>. Then <signal.h> ->
+ <pthread.h> -> <sched.h> -> <spawn.h> are included by GNULIB.
+ In this situation, struct sched_param is not yet defined. */
+
+#@INCLUDE_NEXT@ @NEXT_SPAWN_H@
+
+#else
+
+#ifndef _@GUARD_PREFIX@_SPAWN_H
+/* Normal invocation convention. */
+
/* The include_next requires a split double-inclusion guard. */
#if @HAVE_SPAWN_H@
+
+# define _GL_ALREADY_INCLUDING_SPAWN_H
+
# @INCLUDE_NEXT@ @NEXT_SPAWN_H@
+
+# define _GL_ALREADY_INCLUDING_SPAWN_H
+
#endif
#ifndef _@GUARD_PREFIX@_SPAWN_H
@@ -972,3 +989,4 @@ _GL_WARN_ON_USE (posix_spawn_file_actions_addfchdir,
#endif /* _@GUARD_PREFIX@_SPAWN_H */
#endif /* _@GUARD_PREFIX@_SPAWN_H */
+#endif