[PATCH]: adds missing System properties for gcj under mingw

Adam King aking@dreammechanics.com
Thu Apr 11 06:25:00 GMT 2002


On Tue, Apr 09, 2002 at 11:42:58AM -0600, Tom Tromey wrote:
> >>>>> "Adam" == Adam Megacz <adam@megacz.com> writes:
> 
> Index: ChangeLog
> from  Tom Tromey  <tromey@redhat.com>
> 
> 	* win32.cc (_Jv_platform_initProperties): Use GetTempPath.

The above patch breaks the mingw target:

/home/aking/mingw-gcc/i686-pc-mingw32/include/winbase.h: In function `void
_Jv_platform_initProperties(java::util::Properties*)':
/home/aking/mingw-gcc/i686-pc-mingw32/include/winbase.h:1252: too few arguments
to function `DWORD GetTempPathA(long unsigned int, CHAR*)'
../../../gcc/libjava/win32.cc:79: at this point in file
../../../gcc/libjava/win32.cc:79: invalid conversion from `DWORD' to `const
char*'
../../../gcc/libjava/win32.cc:79:   initializing argument 1 of `
java::lang::String* JvNewStringLatin1(const char*)'
make[2]: *** [win32.lo] Error 1
make[2]: Leaving directory `/home/aking/compile/mingw-gcj/bin/i686-pc-mingw32/libjava'

I believe the correct patch is:

2002-04-11  Adam King <aking@dreammechanics.com>

    * win32.cc (_Jv_platform_initProperties): Fix the way
    GetTempPath() is used.



Index: win32.cc
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/win32.cc,v
retrieving revision 1.4.8.5
diff -u -r1.4.8.5 win32.cc
--- win32.cc	9 Apr 2002 17:46:05 -0000	1.4.8.5
+++ win32.cc	11 Apr 2002 13:12:44 -0000
@@ -76,15 +76,17 @@
   SET ("file.separator", "\\");
   SET ("path.separator", ";");
   SET ("line.separator", "\r\n");
-  SET ("java.io.tmpdir", GetTempPath ());
 
-  // Use GetCurrentDirectory to set 'user.dir'.
   DWORD buflen = MAX_PATH;
   char* buffer = (char *) malloc (buflen);
   if (buffer != NULL)
     {
+      if (GetTempPath (buflen, buffer))
+        SET ("java.io.tmpdir", buffer);
+
+      // Use GetCurrentDirectory to set 'user.dir'.
       if (GetCurrentDirectory (buflen, buffer))
-          SET ("user.dir", buffer);
+        SET ("user.dir", buffer);
       free (buffer);
     }
   



More information about the Java-patches mailing list