[armedbear-cvs] r11750 - trunk/abcl/src/org/armedbear/lisp

Mark Evenson mevenson at common-lisp.net
Sat Apr 11 21:47:08 UTC 2009


Author: mevenson
Date: Sat Apr 11 17:47:05 2009
New Revision: 11750

Log:
Don't die if if the Java system property 'os.arch' doesn't exist.

Google App Engine's JVM does not provide the "os.arch" system, but we
shouldn't be failing for this anyways 'cuz argubly the machine type is
Java.  Still, this might be useful for determining JNI libraries to
load.

If 'os.arch' doesn't exist, use 'UNKNOWN' for machine-type.

Thanks to Vladimir V. Korablin for the patch.




Modified:
   trunk/abcl/src/org/armedbear/lisp/Lisp.java
   trunk/abcl/src/org/armedbear/lisp/machine_type.java

Modified: trunk/abcl/src/org/armedbear/lisp/Lisp.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/Lisp.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/Lisp.java	Sat Apr 11 17:47:05 2009
@@ -2214,12 +2214,14 @@
   static
   {
     String os_arch = System.getProperty("os.arch");
-    if (os_arch.equals("amd64"))
-      Symbol.FEATURES.setSymbolValue(new Cons(Keyword.X86_64,
-                                              Symbol.FEATURES.getSymbolValue()));
-    else if (os_arch.equals("x86"))
-      Symbol.FEATURES.setSymbolValue(new Cons(Keyword.X86,
-                                              Symbol.FEATURES.getSymbolValue()));
+    if(os_arch != null) {
+      if (os_arch.equals("amd64"))
+        Symbol.FEATURES.setSymbolValue(new Cons(Keyword.X86_64,
+                                                Symbol.FEATURES.getSymbolValue()));
+      else if (os_arch.equals("x86"))
+        Symbol.FEATURES.setSymbolValue(new Cons(Keyword.X86,
+                                                Symbol.FEATURES.getSymbolValue()));
+    }
   }
 
   static

Modified: trunk/abcl/src/org/armedbear/lisp/machine_type.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/machine_type.java	(original)
+++ trunk/abcl/src/org/armedbear/lisp/machine_type.java	Sat Apr 11 17:47:05 2009
@@ -45,7 +45,9 @@
   public LispObject execute() throws ConditionThrowable
   {
     String s = System.getProperty("os.arch");
-    if (s.equals("amd64"))
+    if (s == null)
+      s = "UNKNOWN";
+    else if (s.equals("amd64"))
       s = "X86-64";
     else
       s = s.toUpperCase();




More information about the armedbear-cvs mailing list