From: Bruno Haible Date: Sun, 10 May 2026 14:29:18 +0000 (+0200) Subject: sys_wait-h: Fix compilation error on Solaris 10 in C++ mode. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63ca6de45211b9bbee7e34b9601f1a4d87e3354d;p=thirdparty%2Fgnulib.git sys_wait-h: Fix compilation error on Solaris 10 in C++ mode. * lib/sys_wait.in.h (_GL_INCLUDING_SYS_WAIT_H): New macro, to avoid recursive include problems. * modules/sys_wait-h (Makefile.am): Substitute INCLUDE_NEXT_AS_FIRST_DIRECTIVE, NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H. --- diff --git a/ChangeLog b/ChangeLog index fa1a0598e6..0e96accffa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2026-05-10 Bruno Haible + + sys_wait-h: Fix compilation error on Solaris 10 in C++ mode. + * lib/sys_wait.in.h (_GL_INCLUDING_SYS_WAIT_H): New macro, to avoid + recursive include problems. + * modules/sys_wait-h (Makefile.am): Substitute + INCLUDE_NEXT_AS_FIRST_DIRECTIVE, NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H. + 2026-05-10 Bruno Haible strnul: Fix compilation in C++ mode on Solaris 10 with Oracle Studio 12. diff --git a/lib/sys_wait.in.h b/lib/sys_wait.in.h index 884c63d84f..8d4145d782 100644 --- a/lib/sys_wait.in.h +++ b/lib/sys_wait.in.h @@ -22,9 +22,23 @@ #endif @PRAGMA_COLUMNS@ +#if defined _GL_INCLUDING_SYS_WAIT_H +/* Special invocation convention: + - On Solaris 10 we have a sequence of nested includes + -> -> + In this situation, the functions are not yet declared, therefore we cannot + provide the C++ aliases. */ + +#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@ + +#else +/* Normal invocation convention. */ + /* The include_next requires a split double-inclusion guard. */ #if !(defined _WIN32 && ! defined __CYGWIN__) +# define _GL_INCLUDING_SYS_WAIT_H # @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@ +# undef _GL_INCLUDING_SYS_WAIT_H #endif #ifndef _@GUARD_PREFIX@_SYS_WAIT_H @@ -132,4 +146,5 @@ _GL_WARN_ON_USE (waitpid, "waitpid is unportable - " #endif /* _@GUARD_PREFIX@_SYS_WAIT_H */ +#endif /* _GL_INCLUDING_SYS_WAIT_H */ #endif /* _@GUARD_PREFIX@_SYS_WAIT_H */ diff --git a/modules/sys_wait-h b/modules/sys_wait-h index 455cf961fb..d995b1aedb 100644 --- a/modules/sys_wait-h +++ b/modules/sys_wait-h @@ -26,9 +26,11 @@ sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U $(AM_V_GEN)$(MKDIR_P) '%reldir%/sys' $(AM_V_at)$(SED_HEADER_STDOUT) \ -e 's|@''GUARD_PREFIX''@|${gl_include_guard_prefix}|g' \ + -e 's|@''INCLUDE_NEXT_AS_FIRST_DIRECTIVE''@|$(INCLUDE_NEXT_AS_FIRST_DIRECTIVE)|g' \ -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \ -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \ -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \ + -e 's|@''NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H''@|$(NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H)|g' \ -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \ -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \ -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \