? build.log
Index: ChangeLog
===================================================================
RCS file: /sources/classpath/classpath/ChangeLog,v
retrieving revision 1.9499
diff -u -p -r1.9499 ChangeLog
--- ChangeLog	10 Feb 2008 23:29:07 -0000	1.9499
+++ ChangeLog	11 Feb 2008 18:47:28 -0000
@@ -71,6 +71,14 @@
 
 2008-02-09  Dalibor Topic  <robilad@kaffe.org>
 
+	* native/jni/java-lang/java_lang_VMDouble.c (Java_java_lang_VMDouble_longBitsToDouble)
+	(Java_java_lang_VMDouble_doubleToRawLongBits): Added implementation using ieee754.h.
+	Include ieee754.h if available. Added workaround for glibc BIG_ENDIAN bug on arm-linux.
+	
+	* configure.ac: Check for ieee754.h
+
+2008-02-09  Dalibor Topic  <robilad@kaffe.org>
+
 	* native/jni/Makefile.am (all-local): Call check_jni_methods.sh
 	directly.
 
Index: native/jni/java-lang/java_lang_VMDouble.c
===================================================================
RCS file: /sources/classpath/classpath/native/jni/java-lang/java_lang_VMDouble.c,v
retrieving revision 1.19
diff -u -p -r1.19 java_lang_VMDouble.c
--- native/jni/java-lang/java_lang_VMDouble.c	8 Feb 2008 17:42:57 -0000	1.19
+++ native/jni/java-lang/java_lang_VMDouble.c	11 Feb 2008 18:47:32 -0000
@@ -54,6 +54,7 @@ static jmethodID isNaNID;
 static jdouble NEGATIVE_INFINITY;
 static jdouble POSITIVE_INFINITY;
 static jdouble NaN;
+static jboolean swap_words;
 
 /*
  * Class:     java_lang_VMDouble
@@ -66,6 +67,7 @@ Java_java_lang_VMDouble_initIDs (JNIEnv 
   jfieldID negInfID;
   jfieldID posInfID;
   jfieldID nanID;
+  jvalue swap;
 
   clsDouble = (*env)->FindClass (env, "java/lang/Double");
   if (clsDouble == NULL)
@@ -101,6 +103,9 @@ Java_java_lang_VMDouble_initIDs (JNIEnv 
   NEGATIVE_INFINITY = (*env)->GetStaticDoubleField (env, clsDouble, negInfID);
   NaN = (*env)->GetStaticDoubleField (env, clsDouble, nanID);
 
+  swap.d = NaN;
+  swap_words = (0x7ff8000000000000LL == swap.j);
+
 #ifdef DEBUG
   fprintf (stderr, "java.lang.Double.initIDs() POSITIVE_INFINITY = %g\n",
 	   POSITIVE_INFINITY);
@@ -110,6 +115,12 @@ Java_java_lang_VMDouble_initIDs (JNIEnv 
 #endif
 }
 
+  /* On little endian ARM processors when using FPA, word order of
+     doubles is still big endian. So take that into account here. When
+     using VFP, word order of doubles follows byte order. */
+
+#define SWAP_DOUBLE(a)    (((a) << 32) | (((a) >> 32) & 0x00000000ffffffff))
+
 /*
  * Class:     java_lang_VMDouble
  * Method:    doubleToRawLongBits
@@ -124,15 +135,8 @@ Java_java_lang_VMDouble_doubleToRawLongB
 
   val.d = doubleValue;
 
-#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
-  /* On little endian ARM processors when using FPA, word order of
-     doubles is still big endian. So take that into account here. When
-     using VFP, word order of doubles follows byte order. */
-
-#define SWAP_DOUBLE(a)    (((a) << 32) | (((a) >> 32) & 0x00000000ffffffff))
-
-  val.j = SWAP_DOUBLE(val.j);
-#endif
+  if (swap_words)
+    val.j = SWAP_DOUBLE(val.j);
 
   return val.j;
 }
@@ -151,11 +155,11 @@ Java_java_lang_VMDouble_longBitsToDouble
 
   val.j = longValue;
 
-#if defined(__IEEE_BYTES_LITTLE_ENDIAN)
-  val.j = SWAP_DOUBLE(val.j);
-#endif
+  if (swap_words)
+    val.j = SWAP_DOUBLE(val.j);
 
   return val.d;
+
 }
 
 /**
