diff options
author | Tom Tromey <tromey@redhat.com> | 2002-01-16 00:27:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2002-01-16 00:27:05 +0000 |
commit | 9c874875a167bb023af5dd5b0f018757a65afb11 (patch) | |
tree | 473b006b7a1aa177d93c3aac443c2e435d8e3455 /gcc/java/gjavah.c | |
parent | acfab996f3ad303f4d5e9c01dd5e31dda216f3d7 (diff) | |
download | gcc-9c874875a167bb023af5dd5b0f018757a65afb11.zip gcc-9c874875a167bb023af5dd5b0f018757a65afb11.tar.gz gcc-9c874875a167bb023af5dd5b0f018757a65afb11.tar.bz2 |
re PR java/5365 (gcjh -stubs does not include correct files)
Fix for PR java/5365:
* gjavah.c (process_file): Turn class name into a file name.
From-SVN: r48891
Diffstat (limited to 'gcc/java/gjavah.c')
-rw-r--r-- | gcc/java/gjavah.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index db3e16a..d5de1eb 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -1,7 +1,7 @@ /* Program to write C++-suitable header files from a Java(TM) .class file. This is similar to SUN's javah. -Copyright (C) 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. +Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1969,10 +1969,18 @@ DEFUN(process_file, (jcf, out), { /* Strip off the ".class" portion of the name when printing the include file name. */ - int len = strlen (jcf->classname); + char *name; + int i, len = strlen (jcf->classname); if (len > 6 && ! strcmp (&jcf->classname[len - 6], ".class")) len -= 6; - print_include (out, jcf->classname, len); + /* Turn the class name into a file name. */ + name = xmalloc (len + 1); + for (i = 0; i < len; ++i) + name[i] = jcf->classname[i] == '.' ? '/' : jcf->classname[i]; + name[i] = '\0'; + print_include (out, name, len); + free (name); + if (! flag_jni) print_include (out, "gcj/cni", -1); } |