* [patch] include/posix.h
@ 2006-05-19 22:16 Andreas Tobler
2006-05-22 21:25 ` Tom Tromey
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Tobler @ 2006-05-19 22:16 UTC (permalink / raw)
To: Java Patches
Hello all,
to complete the HP-UX PA port we need to modify the file in the subject.
We conflict with the gcj/javaprims.h and the Boolean.h when we compile
java/net/natVMNetworkInterfacePosix.cc
The reason comes from the system header sys/rw_lock.h:
-----
/*
* For source compatibility, need to continue defining TRUE and FALSE for
* user-level applications. Although this file defines a kernel only
service,
* some user-level applications are indirectly including this file and
* depending on the defines for TRUE and FALSE. These defines need to
* remain until all the user-level issues have been handled.
*/
#ifndef _KERNEL
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#else
#if ((TRUE != 1) || (FALSE != 0))
This is probably not a good thing....
#endif
#endif /* !TRUE */
-----
Do you have a better idea or is the below ok?
Thanks,
Andreas
2006-05-20 Andreas Tobler <a.tobler@schweiz.ch>
* include/posix.h: Undefine TRUE and FALSE.
Index: include/posix.h
===================================================================
--- include/posix.h (revision 113914)
+++ include/posix.h (working copy)
@@ -47,6 +47,8 @@
#else
#define _Jv_platform_solib_suffix ".so"
#endif
+#undef TRUE
+#undef FALSE
// Some POSIX systems don't have O_SYNC and O_DYSNC so we define them
here.
// Needed in java/io/natFileDescriptorPosix.cc.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] include/posix.h
2006-05-19 22:16 [patch] include/posix.h Andreas Tobler
@ 2006-05-22 21:25 ` Tom Tromey
2006-05-23 19:47 ` Andreas Tobler
0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2006-05-22 21:25 UTC (permalink / raw)
To: Andreas Tobler; +Cc: Java Patches
>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:
Andreas> We conflict with the gcj/javaprims.h and the Boolean.h when we compile
Andreas> java/net/natVMNetworkInterfacePosix.cc
Thanks.
What if we handled this more directly and generated a Boolean.h that
had the #undefs at the top? I think that would work a bit better in
more cases. Otherwise we're dependent on the order of inclusion of
our posix.h, system headers, and Boolean.h.
This can be implemented with a small Makefile change. Could you try
it? Or is there a problem with this?
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] include/posix.h
2006-05-22 21:25 ` Tom Tromey
@ 2006-05-23 19:47 ` Andreas Tobler
2006-05-24 0:39 ` Tom Tromey
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Tobler @ 2006-05-23 19:47 UTC (permalink / raw)
To: tromey; +Cc: Java Patches, John David Anglin
Tom Tromey wrote:
>>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:
>
> Andreas> We conflict with the gcj/javaprims.h and the Boolean.h when we compile
> Andreas> java/net/natVMNetworkInterfacePosix.cc
>
> Thanks.
>
> What if we handled this more directly and generated a Boolean.h that
> had the #undefs at the top? I think that would work a bit better in
> more cases. Otherwise we're dependent on the order of inclusion of
> our posix.h, system headers, and Boolean.h.
Well, this does not help if Boolean.h is included before such magic
system headers which define TRUE and FALSE again.
In our case sys/rw_lock.h, the file where this (re)-definition happens,
is included after Boolean.h, implicitely. So I tend to agree with Dave
that the workaround he proposes is probably the best one in regard of
effort and gain.
Thanks,
Andreas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] include/posix.h
2006-05-23 19:47 ` Andreas Tobler
@ 2006-05-24 0:39 ` Tom Tromey
2006-05-25 23:21 ` John David Anglin
0 siblings, 1 reply; 5+ messages in thread
From: Tom Tromey @ 2006-05-24 0:39 UTC (permalink / raw)
To: Andreas Tobler; +Cc: Java Patches, John David Anglin
>>>>> "Andreas" == Andreas Tobler <toa@pop.agri.ch> writes:
Andreas> Well, this does not help if Boolean.h is included before such magic
Andreas> system headers which define TRUE and FALSE again.
Yeah. However, any ordering will have an associated potential
failure mode, afaics.
Andreas> In our case sys/rw_lock.h, the file where this (re)-definition
Andreas> happens, is included after Boolean.h, implicitely. So I tend to agree
Andreas> with Dave that the workaround he proposes is probably the best one in
Andreas> regard of effort and gain.
That patch also looked fine to me. Feel free to check it in.
Tom
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [patch] include/posix.h
2006-05-24 0:39 ` Tom Tromey
@ 2006-05-25 23:21 ` John David Anglin
0 siblings, 0 replies; 5+ messages in thread
From: John David Anglin @ 2006-05-25 23:21 UTC (permalink / raw)
To: tromey; +Cc: toa, java-patches, gcc-patches
> Andreas> In our case sys/rw_lock.h, the file where this (re)-definition
> Andreas> happens, is included after Boolean.h, implicitely. So I tend to agree
> Andreas> with Dave that the workaround he proposes is probably the best one in
> Andreas> regard of effort and gain.
>
> That patch also looked fine to me. Feel free to check it in.
Done.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2006-05-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* configure.ac: Add sys/rw_lock.h to AC_CHECK_HEADERS.
* configure: Rebuilt.
* include/config.h.in: Likewise.
* include/posix.h: If HAVE_SYS_RW_LOCK_H is defined, include
<sys/rw_lock.h>.
Index: configure.ac
===================================================================
--- configure.ac (revision 113941)
+++ configure.ac (working copy)
@@ -1276,7 +1276,7 @@
sys/ioctl.h sys/filio.h sys/stat.h sys/select.h \
sys/socket.h netinet/in.h arpa/inet.h netdb.h net/if.h \
pwd.h sys/config.h stdint.h langinfo.h locale.h \
- dirent.h])
+ dirent.h sys/rw_lock.h])
AC_CHECK_HEADERS(inttypes.h, [
AC_DEFINE(HAVE_INTTYPES_H, 1, [Define if <inttypes.h> is available])
AC_DEFINE(JV_HAVE_INTTYPES_H, 1, [Define if <inttypes.h> is available])
Index: include/posix.h
===================================================================
--- include/posix.h (revision 113941)
+++ include/posix.h (working copy)
@@ -37,6 +37,12 @@
#include <fcntl.h>
+/* The header file <sys/rw_lock.h> needs to be included before javaprims.h
+ on HP-UX 11 to avoid a compilation error. */
+#ifdef HAVE_SYS_RW_LOCK_H
+#include <sys/rw_lock.h>
+#endif
+
#include <gcj/cni.h>
#include <java/util/Properties.h>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-05-25 23:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-19 22:16 [patch] include/posix.h Andreas Tobler
2006-05-22 21:25 ` Tom Tromey
2006-05-23 19:47 ` Andreas Tobler
2006-05-24 0:39 ` Tom Tromey
2006-05-25 23:21 ` John David Anglin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).