vxworks's dup function is not declared in unistd.h, but c++23/print.cc
expects to be able to call it if unistd.h is available.  On vxworks,
the function is only declared in ioLib.h, so arrange to include it.

Tested with gcc-14 targeting ppc-vx7r2 and ppc64-vx7r2.  Also tested
with trunk on ppc64le-linux-gnu, and with gcc-14 targeting powerpc-elf.
Ok to install?


for  libstdc++-v3/ChangeLog

        * src/c++23/print.cc [__VXWORKS__]: Include ioLib.h.
---
 libstdc++-v3/src/c++23/print.cc |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libstdc++-v3/src/c++23/print.cc b/libstdc++-v3/src/c++23/print.cc
index 8ba7140596726..f343699500961 100644
--- a/libstdc++-v3/src/c++23/print.cc
+++ b/libstdc++-v3/src/c++23/print.cc
@@ -43,6 +43,10 @@
 # include <unistd.h>  // isatty
 #endif
 
+#ifdef __VXWORKS__
+#include <ioLib.h>
+#endif
+
 namespace std _GLIBCXX_VISIBILITY(default)
 {
 _GLIBCXX_BEGIN_NAMESPACE_VERSION


-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
More tolerance and less prejudice are key for inclusion and diversity.
Excluding neuro-others for not behaving ""normal"" is *not* inclusive!

Reply via email to