This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix gcjh -jni
- From: Tom Tromey <tromey at redhat dot com>
- To: GNU Classpath Patches <classpath-patches at gnu dot org>
- Cc: GCJ-patches <java-patches at gcc dot gnu dot org>
- Date: 26 Mar 2007 15:54:06 -0600
- Subject: Patch: FYI: fix gcjh -jni
- Reply-to: tromey at redhat dot com
I'm checking this in to classpath, gcc trunk, and the RH 4.1 branch.
Stepan Kasal noticed that 'gcjh -jni' fails incorrectly.
Whoops.
Tom
Index: ChangeLog
from Stepan Kasal <skasal@redhat.com>
* tools/gnu/classpath/tools/javah/Main.java (cniOrJniSeen): New
field.
(getParser): Use new field.
Index: tools/gnu/classpath/tools/javah/Main.java
===================================================================
RCS file: /cvsroot/classpath/classpath/tools/gnu/classpath/tools/javah/Main.java,v
retrieving revision 1.8
diff -u -r1.8 Main.java
--- tools/gnu/classpath/tools/javah/Main.java 17 Mar 2007 05:01:57 -0000 1.8
+++ tools/gnu/classpath/tools/javah/Main.java 26 Mar 2007 17:31:03 -0000
@@ -89,6 +89,9 @@
// True if we're emitting CNI code.
boolean cni;
+ // True if we've seen -cni or -jni.
+ boolean cniOrJniSeen;
+
// True if output files should always be written.
boolean force;
@@ -243,8 +246,9 @@
{
public void parsed(String arg0) throws OptionException
{
- if (cni)
+ if (cniOrJniSeen && cni)
throw new OptionException("only one of -jni or -cni may be used");
+ cniOrJniSeen = true;
cni = false;
}
});
@@ -252,6 +256,9 @@
{
public void parsed(String arg0) throws OptionException
{
+ if (cniOrJniSeen && ! cni)
+ throw new OptionException("only one of -jni or -cni may be used");
+ cniOrJniSeen = true;
cni = true;
}
});