This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: natFile.cc does not compile in OSF1
- To: Tom Tromey <tromey at redhat dot com>
- Subject: Re: natFile.cc does not compile in OSF1
- From: Antonio Ake <ake at ecn dot purdue dot edu>
- Date: Sun, 15 Jul 2001 02:08:21 -0500 (EST)
- cc: <java at gcc dot gnu dot org>
Thanks Tom. Libgcj passed this point with your patch.
On 14 Jul 2001, Tom Tromey wrote:
> >>>>> "Antonio" == Antonio Ake <ake@ecn.purdue.edu> writes:
>
> Antonio> I am working with 3.0.1 and my architecture is OSF1 V5.0 910
> Antonio> alpha I am trying to build libgcj, when is compiling
> Antonio> natFile.cc I have a problem with the java::io::File:stat
> Antonio> command:
>
> Thanks for your report.
>
> I think the simplest way around this is to rename `stat' (and
> `access', just in case) to `_stat'.
>
> Could you try this patch?
> If it works for you I will check it in to the trunk and the branch.
>
> 2001-07-14 Tom Tromey <tromey@redhat.com>
>
> * java/io/natFileWin32.cc (_access): Renamed.
> (_stat): Likewise.
> * java/io/natFile.cc (_access): Renamed.
> (_stat): Likewise.
> * java/io/File.java (access, stat): Add leading `_' to name.
> Updated all callers.
>
> Tom
>
> Index: java/io/File.java
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/java/io/File.java,v
> retrieving revision 1.18
> diff -u -r1.18 File.java
> --- java/io/File.java 2001/04/12 09:32:50 1.18
> +++ java/io/File.java 2001/07/15 00:19:27
> @@ -29,13 +29,13 @@
> public boolean canRead ()
> {
> checkRead();
> - return access (READ);
> + return _access (READ);
> }
>
> public boolean canWrite ()
> {
> checkWrite();
> - return access (WRITE);
> + return _access (WRITE);
> }
>
> private native boolean performCreate() throws IOException;
> @@ -71,7 +71,7 @@
> public boolean exists ()
> {
> checkRead();
> - return access (EXISTS);
> + return _access (EXISTS);
> }
>
> public File (String p)
> @@ -209,20 +209,20 @@
> public boolean isDirectory ()
> {
> checkRead();
> - return stat (DIRECTORY);
> + return _stat (DIRECTORY);
> }
>
> public boolean isFile ()
> {
> checkRead();
> - return stat (ISFILE);
> + return _stat (ISFILE);
> }
>
> /** @since 1.2 */
> public boolean isHidden()
> {
> checkRead();
> - return stat (ISHIDDEN);
> + return _stat (ISHIDDEN);
> }
>
> public long lastModified ()
> @@ -566,8 +566,11 @@
> private final static int LENGTH = 1;
>
> private final native long attr (int query);
> - private final native boolean access (int query);
> - private final native boolean stat (int query);
> + // On OSF1 V5.0, `stat' is a macro. It is easiest to use the name
> + // `_stat' instead. We do the same thing for `_access' just in
> + // case.
> + private final native boolean _access (int query);
> + private final native boolean _stat (int query);
>
> private static final long serialVersionUID = 301077366599181567L;
> }
> Index: java/io/natFile.cc
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/java/io/natFile.cc,v
> retrieving revision 1.12
> diff -u -r1.12 natFile.cc
> --- java/io/natFile.cc 2001/06/01 04:04:10 1.12
> +++ java/io/natFile.cc 2001/07/15 00:19:27
> @@ -37,7 +37,7 @@
> #include <java/lang/System.h>
>
> jboolean
> -java::io::File::access (jint query)
> +java::io::File::_access (jint query)
> {
> char buf[MAXPATHLEN];
> jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
> @@ -59,7 +59,7 @@
> }
>
> jboolean
> -java::io::File::stat (jint query)
> +java::io::File::_stat (jint query)
> {
> char buf[MAXPATHLEN];
> jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
> Index: java/io/natFileWin32.cc
> ===================================================================
> RCS file: /cvs/gcc/gcc/libjava/java/io/natFileWin32.cc,v
> retrieving revision 1.4
> diff -u -r1.4 natFileWin32.cc
> --- java/io/natFileWin32.cc 2001/04/02 05:23:10 1.4
> +++ java/io/natFileWin32.cc 2001/07/15 00:19:27
> @@ -25,7 +25,7 @@
> #include <java/lang/System.h>
>
> jboolean
> -java::io::File::access (jint query)
> +java::io::File::_access (jint query)
> {
> char buf[MAX_PATH];
> jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
> @@ -46,7 +46,7 @@
> }
>
> jboolean
> -java::io::File::stat (jint query)
> +java::io::File::_stat (jint query)
> {
> char buf[MAX_PATH];
> jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
>