This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: Make "os.arch" consistent with Sun's JDK on Win32


Hi,

    This patch is in response to a recent request on the main
mailing list to make the value of the "os.arch" system property
on Win32 more like what Sun's JDK sets - namely "x86" instead 
of the current "i486" or "i586" for GCJ running on Win32.

This patch also sets these names for Windows NT running on other
architectures (alpha, mips, etc.) - I do not know if these are
consistent with what Sun's JDK on these platforms returns *if
such ports of the JDK exist at all* - Windows NT has long ceased 
to exist on Alpha, PPC and MIPS. (Except for IA64 - we should
update this when we come to know what Sun's JDK on Win/IA64
sets.)

Ranjit.


Index: ChangeLog
from  Ranjit Mathew  <rmathew@hotmail.com>

	* win32.cc (_Jv_platform_initProperties): Use generic names
	like "x86" for the "os.arch" property to be consistent with
	what Sun's JDK produces. Use the wProcessorArchitecture
	member of the Win32 SYSTEM_INFO structure, filled in a call 
	to GetSystemInfo( ), instead of dwProcessorType.

Index: win32.cc
===================================================================
--- win32.cc	2003-02-16 21:30:02.000000000 +0530
+++ win32.cc	2003-02-16 21:41:56.000000000 +0530
@@ -174,21 +174,22 @@
   SYSTEM_INFO si;
   GetSystemInfo (&si);
-  switch (si.dwProcessorType)
+  switch (si.wProcessorArchitecture)
     {
-      case PROCESSOR_INTEL_386:
-        SET ("os.arch", "i386");
+      case PROCESSOR_ARCHITECTURE_INTEL:
+        SET ("os.arch", "x86");
         break;
-      case PROCESSOR_INTEL_486:
-        SET ("os.arch", "i486");
+      case PROCESSOR_ARCHITECTURE_MIPS:
+        SET ("os.arch", "mips");
         break;
-      case PROCESSOR_INTEL_PENTIUM:
-        SET ("os.arch", "i586");
+      case PROCESSOR_ARCHITECTURE_ALPHA:
+        SET ("os.arch", "alpha");
         break;
-      case PROCESSOR_MIPS_R4000:	
-        SET ("os.arch", "MIPS4000");
+      case PROCESSOR_ARCHITECTURE_PPC:	
+        SET ("os.arch", "ppc");
         break;
-      case PROCESSOR_ALPHA_21064:
-        SET ("os.arch", "ALPHA");
+      case PROCESSOR_ARCHITECTURE_IA64:
+        SET ("os.arch", "ia64");
         break;
+      case PROCESSOR_ARCHITECTURE_UNKNOWN:
       default:
         SET ("os.arch", "unknown");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]