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
This commit is contained in:
Tom Tromey 2003-05-03 02:29:26 +00:00 committed by Tom Tromey
parent de7222559c
commit 73cb3b5a41
2 changed files with 38 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2003-05-02 Tom Tromey <tromey@redhat.com>
PR java/10491:
* gjavah.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
(handle_inner_classes): New function.
2003-05-01 Tom Tromey <tromey@redhat.com>
PR java/10459:

View File

@ -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