TRUE&FALSE conflicts on alpha*-dec-osf4.0d

Alexandre Oliva
Mon Jul 19 02:21:00 GMT 1999

sys/types.h defines TRUE and FALSE to 1 and 0, respectively, unless
they're already defined, causing programs that include
java/lang/Boolean.h after sys/types.h to fail to build.

This patch assumes that header files are well-behaved, in the sense
that they won't redefine TRUE and FALSE if they're already defined, if
they define them at all, or that they'll be included before
javaprims.h.  The first alternative is probably reasonable; I'm not
sure about the second, but I can't see any clean solution other than
special-casing java/lang/Boolean.h's TRUE and FALSE in gcjh,
#undefining them just before their declarations.  It's probably not
worth the trouble.

The choice of javaprims.h was arbitrary, it just seemed reasonable.

Here's the patch.  It hasn't caused any regressions on the targets
I've tested it ({Solaris,GNU/Linux}/{sparc,x86} and IRIX6.3/mips).

More information about the Java-patches mailing list