diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2011-07-07 11:00:49 +0000 |
---|---|---|
committer | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2011-07-07 11:00:49 +0000 |
commit | 3413a6a4270a01c5eb77d886b022e9d19b93eb77 (patch) | |
tree | c9fa1028fa8e4f9339ec76049263a42983596856 /tools | |
parent | 820b03ea43b2e60285fba8d6a2029d232f097759 (diff) | |
download | classpath-3413a6a4270a01c5eb77d886b022e9d19b93eb77.tar.gz |
PR classpath/40188: javah creates constants using name of the superclass
2011-07-07 Andrew John Hughes <ahughes@redhat.com>
PR classpath/40188
* tools/gnu/classpath/tools/javah/JniIncludePrinter.java:
(writeFields(ClassWrapper,JniPrintStream)): Retain a
reference to the original class and use it in naming
fields, as opposed to the class in which it occurs.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/gnu/classpath/tools/javah/JniIncludePrinter.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/gnu/classpath/tools/javah/JniIncludePrinter.java b/tools/gnu/classpath/tools/javah/JniIncludePrinter.java index cb8bcd8d9..cf5fed39f 100644 --- a/tools/gnu/classpath/tools/javah/JniIncludePrinter.java +++ b/tools/gnu/classpath/tools/javah/JniIncludePrinter.java @@ -1,5 +1,5 @@ /* JniIncludePrinter.java - Generate a JNI header file - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2011 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -63,6 +63,7 @@ public class JniIncludePrinter { klass.linkSupers(); boolean wroteAny = false; + ClassWrapper headerClass = klass; for (; klass != null; klass = klass.superClass) { Iterator<?> i = klass.fields.iterator(); @@ -77,7 +78,7 @@ public class JniIncludePrinter continue; // Note that we don't want to mangle the field name. - String name = (JniHelper.mangle(klass.name) + "_" + field.name); + String name = (JniHelper.mangle(headerClass.name) + "_" + field.name); out.print("#undef "); out.println(name); out.print("#define "); |