This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] [Java]: Include coretypes.h, jcf-.h in win32-host.c


Hi Andrew,

> > >Mohan, could you please sort this out?
> > 
> > I was able to reproduce this and fix this by including both coretypes.h
> > and jcf.h.
> > 
> > ...<i>but</i> if #include "jcf.h" can't be done without #include "coretypes.h",
> > wouldn't it be better to include coretypes.h in jcf.h and eliminate the
> > double-include everywhere else?
>
>That depends.  Files that use "coretypes.h" should include it,
>regardless of whether "jcf.h" includes it.  But they shouldn't have to
>include "coretypes.h" themselves if they don't use anything in it.
>
> > Let me know either way and I'll submit a patch.
>
>Please do the right thing.

The following patch is not as far-reaching as what we wanted, but follows
the path of least resistance by doing the same thing that the other files
do. It eliminates the warning when compiling win32-host.c on a Win32 host.
(This is a do-nothing file for non-Win32 hosts.)

I tested this in conjunction with the following patches (required to unbreak
build != host Java builds):

- http://gcc.gnu.org/ml/gcc-patches/2004-09/msg00586.html
  (Zack said he would approve this if you approved the next one.)

- http://gcc.gnu.org/ml/gcc-patches/2004-09/msg00587.html
  (Needs your review.)

...for the following builds using cvs -D 2004-09-01:

- (i686-pc-linux-gnu,i686-pc-linux-gnu,i686-pc-linux-gnu)
- (i686-pc-linux-gnu,i686-pc-linux-gnu,i686-pc-mingw32)
- (i686-pc-linux-gnu,i686-pc-mingw32,i686-pc-mingw32)

...and successfully building and running both C++ and Java executables
on these. (The patch itself is written against current CVS HEAD but applies
cleanly to 2004-09-01. I can't test this against CVS HEAD because it doesn't
build.)

-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/

2004-09-07  Mohan Embar  <gnustuff@thisiscool.com>

	* Make-lang.in (java/win32-host.o): Add dependency on
	coretypes.h.
	* win32-host.c: Add includes for coretypes.h, jcf.h

Index: Make-lang.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Make-lang.in,v
retrieving revision 1.141
diff -u -2 -r1.141 Make-lang.in
--- Make-lang.in	5 Aug 2004 19:29:09 -0000	1.141
+++ Make-lang.in	5 Sep 2004 03:08:50 -0000
@@ -326,5 +327,5 @@
 java/typeck.o: java/typeck.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
   java/convert.h toplev.h $(SYSTEM_H) coretypes.h $(TM_H) $(GGC_H) real.h
-java/win32-host.o: java/win32-host.c $(CONFIG_H) $(SYSTEM_H) java/jcf.h
+java/win32-host.o: java/win32-host.c $(CONFIG_H) $(SYSTEM_H) coretypes.h java/jcf.h
 java/verify.o: java/verify.c $(CONFIG_H) $(JAVA_TREE_H) java/jcf.h \
   java/javaop.h java/java-opcodes.h java/java-except.h toplev.h $(SYSTEM_H) \
Index: win32-host.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/win32-host.c,v
retrieving revision 1.4
diff -u -2 -r1.4 win32-host.c
--- win32-host.c	13 Aug 2003 07:08:29 -0000	1.4
+++ win32-host.c	5 Sep 2004 03:08:50 -0000
@@ -29,4 +29,6 @@
 #include "config.h"
 #include "system.h"
+#include "coretypes.h"
+#include "jcf.h"
 
 #define WIN32_LEAN_AND_MEAN





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]