bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PATCH 1/7] spawn: Use special invocation for <spawn.h> on OS/2 kLIBC
@ 2021-01-18 16:40 KO Myung-Hun
  2021-01-18 16:40 ` [PATCH 2/7] yield: Fix linkage to threadlib " KO Myung-Hun
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: KO Myung-Hun @ 2021-01-18 16:40 UTC (permalink / raw)
  To: bug-gnulib

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.

* lib/spawn.in.h: Use special invocation to include <spawn.h> properly
on OS/2 kLIBC.
---
 lib/spawn.in.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/lib/spawn.in.h b/lib/spawn.in.h
index 326b79e6c..35e78e6cf 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
-- 
2.22.0



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-01-31  8:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 16:40 [PATCH 1/7] spawn: Use special invocation for <spawn.h> on OS/2 kLIBC KO Myung-Hun
2021-01-18 16:40 ` [PATCH 2/7] yield: Fix linkage to threadlib " KO Myung-Hun
2021-01-18 16:40 ` [PATCH 3/7] stddef: Fix compilation for max_align_t " KO Myung-Hun
2021-01-18 16:40 ` [PATCH 4/7] stdlib: putenv() needs a cast " KO Myung-Hun
2021-01-19 17:54   ` Bruno Haible
2021-01-22 14:35     ` KO Myung-Hun
2021-01-31  8:32     ` KO Myung-Hun
2021-01-18 16:40 ` [PATCH 5/7] zerosize-ptr: Fix compilation " KO Myung-Hun
2021-01-19 18:10   ` Bruno Haible
2021-01-22 14:26     ` KO Myung-Hun
2021-01-18 16:40 ` [PATCH 6/7] dirent: Redefine dirfd macro as a rpl function always KO Myung-Hun
2021-01-18 16:40 ` [PATCH 7/7] spawn-pipe: Fix SIGSEGV on OS/2 kLIBC KO Myung-Hun
2021-01-19 18:28 ` [PATCH 1/7] spawn: Use special invocation for <spawn.h> " Bruno Haible
2021-01-22 14:37   ` KO Myung-Hun

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