Subject: Re: xdr_float.c?
To: Noriyuki Soda <soda@sra.co.jp>
From: Gordon W. Ross <gwr@netbsd.org>
List: tech-toolchain
Date: 03/30/1999 22:22:29
How about the trivial solution below?
Add this somewhere widely included:
i.e. src/sys/arch/mips/include/cdefs.h
#if defined(__mipseb__) || defined(__mipsel_)
#define __mips__ 1
#endif
Noriyuki Soda writes:
> [...]
> In many case, "if defined(__mips__)" seems to be better than
> "if defined(__mipseb__) || defined(__mipsel_)". If the code doesn't
> concern with the endian, why don't just use "__mips__" ?
> The "__mips__" symbol is defined on all MIPS platforms, not only NetBSD,
> thus we cannot remove -D__mips__ from gcc configuration, anyway.
>
> The real problem seems to be that there is no symbol which defines CPU
> architecure ("mips").
>
> The "MACHINE" is needed because we have to distinct the platform.
> The "MACHINE_ARCH" is needed because we have to distinct the binary
> compatibility.
> But there is no symbol which can be used to distinct the source level
> compatibility. If such symbol exist, we can remove all hacks like
> ${MACHINE_ARCH:C/mipse[bl]/mips/}.
>
> There will be same problem on SH3. (SH3 runs both little and big endian).
> --
> soda