aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/gjavah.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2003-05-03 02:29:26 +0000
committerTom Tromey <tromey@gcc.gnu.org>2003-05-03 02:29:26 +0000
commit73cb3b5a41dd36ae2f2537e2121d27f00a6c38ef (patch)
treef3e1b27dd0a4b2018740e766f60717b97286c074 /gcc/java/gjavah.c
parentde7222559c05f8ca95a97ae6b776acec63c954ea (diff)
downloadgcc-73cb3b5a41dd36ae2f2537e2121d27f00a6c38ef.zip
gcc-73cb3b5a41dd36ae2f2537e2121d27f00a6c38ef.tar.gz
gcc-73cb3b5a41dd36ae2f2537e2121d27f00a6c38ef.tar.bz2
re PR java/10491 (gcjh should make enclosing class a "friend" of inner classes)
PR java/10491: * gjavah.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro. (handle_inner_classes): New function. From-SVN: r66416
Diffstat (limited to 'gcc/java/gjavah.c')
-rw-r--r--gcc/java/gjavah.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 24c3933..80cccd1 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -160,6 +160,8 @@ static void jni_print_float (FILE *, jfloat);
static void jni_print_double (FILE *, jdouble);
static void decompile_return_statement (FILE *, JCF *, int, int, int);
+static void handle_inner_classes (int);
+
JCF_u2 current_field_name;
JCF_u2 current_field_value;
JCF_u2 current_field_signature;
@@ -241,6 +243,8 @@ static int decompiled = 0;
if (out && method_printed && !method_synthetic) \
fputs (decompiled || stubs ? "\n" : ";\n", out);
+#define HANDLE_INNERCLASSES_ATTRIBUTE(COUNT) handle_inner_classes (COUNT)
+
/* We're going to need {peek,skip}_attribute, enable their definition. */
#define NEED_PEEK_ATTRIBUTE
#define NEED_SKIP_ATTRIBUTE
@@ -1674,6 +1678,34 @@ super_class_name (JCF *derived_jcf, int *len)
return supername;
}
+static void
+handle_inner_classes (int count)
+{
+ int i;
+
+ if (out && ! flag_jni && ! stubs && count > 0)
+ fprintf (out, "\n");
+
+ for (i = 0; i < count; ++i)
+ {
+ JCF_u2 inner_info_index = JCF_readu2 (current_jcf);
+
+ /* There are a few more values here, but we don't care about
+ them. The (void) cast is apparently the only way to avoid a
+ warning here. */
+ (void) JCF_readu2 (current_jcf);
+ (void) JCF_readu2 (current_jcf);
+ (void) JCF_readu2 (current_jcf);
+
+ if (out && ! flag_jni && ! stubs)
+ {
+ print_mangled_classname (out, current_jcf, " friend class ",
+ inner_info_index);
+ fprintf (out, ";\n");
+ }
+ }
+}
+
/* We keep track of all the `#include's we generate, so we can avoid