diff options
author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-03 02:29:26 +0000 |
---|---|---|
committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-05-03 02:29:26 +0000 |
commit | d2ea27a3bc16aa0561246d22fcbade652ffe95bc (patch) | |
tree | f3e1b27dd0a4b2018740e766f60717b97286c074 /gcc/java/gjavah.c | |
parent | d8b01fbed416cb58f5782aa2a9d2548870a55e74 (diff) | |
download | gcc-d2ea27a3bc16aa0561246d22fcbade652ffe95bc.tar.gz |
PR java/10491:
* gjavah.c (HANDLE_INNERCLASSES_ATTRIBUTE): New macro.
(handle_inner_classes): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@66416 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/gjavah.c')
-rw-r--r-- | gcc/java/gjavah.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 24c3933a05d..80cccd12a98 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 |