fixincludes: vxworks: regs.h: Fix includes in regs.h wrapper
authorRasmus Villemoes <rv@rasmusvillemoes.dk>
Tue, 16 Oct 2018 09:40:27 +0000 (11:40 +0200)
committerRasmus Villemoes <villemoes@gcc.gnu.org>
Tue, 16 Oct 2018 09:40:27 +0000 (09:40 +0000)
commit92a7f46b09d825e9c18b3f7e9154495f82b01e5c
tree3251f4094fc4497acdcdabc5fec7edc90fe23c89
parentca3a27b6389aceef621dc64f4867b4c14868fe11
fixincludes: vxworks: regs.h: Fix includes in regs.h wrapper

A quick experiment reveals that this hack is needed for C code - simply
removing this hack entirely breaks the build of libstdc++, since
regs.h (more accurately, the cpu-specific header it pulls in) defines
structs in terms of types from vxTypesOld. Those definitions are
properly guarded by #ifndef _ASMLANGUAGE, but the cpu-files do not take
care to include vxTypesOld.h for the types they depend on.

But when using regs.h from some assembly file, the assembler chokes on
the typedefs in vxTypesOld.h. We can fix that by guarding the include of
vxTypesOld by !_ASMLANGUAGE. This should not affect existing C code.

Now, the OS' regs.h contains preprocessor conditionals such as

#if     CPU_FAMILY==I960
...
#endif  /* CPU_FAMILY==I960 */
#if     CPU_FAMILY==MC680X0
...
#endif  /* CPU_FAMILY==MC680X0 */

Without definitions of CPU_FAMILY, I960 etc., these would all be true,
which will not end well. Code using the fix-included regs.h
automatically get vxCpu.h via a chain of includes from vxTypesOld.h, but
we can make regs.h a little more self-contained for both C and asm users
by doing an explicit include of vxCpu.h.

From-SVN: r265187
fixincludes/ChangeLog
fixincludes/fixincl.x
fixincludes/inclhack.def