Account for VxWorks headers in libstdc++ test on names

Alexandre Oliva oliva@adacore.com
Tue Dec 22 21:38:58 GMT 2020


Undefine various macros unexpectedly defined by VxWorks headers.

Regstrapped on x86_64-linux-gnu, and tested with -x-arm-wrs-vxworks7r2.
Ok to install?


from Olivier Hainque <hainque@adacore.com>
for  libstdc++-v3/ChangeLog

	* testsuite/17_intro/names.cc: Account for VxWorks headers.
---
 libstdc++-v3/testsuite/17_intro/names.cc |   41 ++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index 2c8bfff26e1ca..4760a9efd7991 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -211,4 +211,45 @@
 #undef ptr
 #endif
 
+#ifdef __VXWORKS__
+
+#include <_vxworks-versions.h>
+
+// Some VxWorks 6 or 7 headers are using those.
+
+// private/objLibP.h
+#undef u
+
+// arch/ppc/ffs/ArchLib.h
+#undef i
+#undef j
+
+// math.h
+#undef x
+#undef y
+
+// stdio.h
+#undef ptr
+
+// VxWorks >= 7 specificities
+
+#if _VXWORKS_MAJOR_GE(7)
+
+// regs.h regs structure has a field 'r'
+#undef r
+
+#ifndef __RTP__
+// in bootLib.h, bootParamCheck has parameters x, a-f
+#undef a
+#undef b
+#undef c
+#undef d
+#undef e
+#undef f
+#endif // __RTP__
+
+#endif // VxWorks Major >= 7
+
+#endif // __VXWORKS__
+
 #include <bits/stdc++.h>


-- 
Alexandre Oliva, happy hacker  https://FSFLA.org/blogs/lxo/
   Free Software Activist         GNU Toolchain Engineer
        Vim, Vi, Voltei pro Emacs -- GNUlius Caesar


More information about the Gcc-patches mailing list