summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2007-03-26 22:10:11 +0000
committerTom Tromey <tromey@redhat.com>2007-03-26 22:10:11 +0000
commit74840d562b3a8226cb9ab2eca94bc061be6ae7ab (patch)
tree0e788a08bf2008b78617b8bae421022bb1c43506 /tools
parent0e6bbeaf0933891d1320b0c1060a63ceeecadf81 (diff)
downloadclasspath-74840d562b3a8226cb9ab2eca94bc061be6ae7ab.tar.gz
2007-03-26 Stepan Kasal <skasal@redhat.com>
* tools/gnu/classpath/tools/javah/Main.java (cniOrJniSeen): New field. (getParser): Use new field.
Diffstat (limited to 'tools')
-rw-r--r--tools/gnu/classpath/tools/javah/Main.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/gnu/classpath/tools/javah/Main.java b/tools/gnu/classpath/tools/javah/Main.java
index dfa04c4c9..29c96cf5b 100644
--- a/tools/gnu/classpath/tools/javah/Main.java
+++ b/tools/gnu/classpath/tools/javah/Main.java
@@ -89,6 +89,9 @@ public class Main
// 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 class Main
{
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 class Main
{
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;
}
});