Patch: portability fixes from Jeff Sturm

Tom Tromey tromey@cygnus.com
Mon Jan 10 11:49:00 GMT 2000


I'm checking in the appended patch, which fixes some HP build
problems.

2000-01-10  Jeff Sturm  <jsturm@sigma6.com>

	* java/lang/natMath.cc (pow): Cast args to `double', not
	`jdouble'.
	(atan2): Likewise.
	(IEEEremainder): Likewise.
	* java/lang/mprec.h: Don't wrap includes in `extern "C"'.
	* java/lang/fdlibm.h: Don't wrap includes in `extern "C"'.

Tom

Index: java/lang/fdlibm.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/fdlibm.h,v
retrieving revision 1.2
diff -u -r1.2 fdlibm.h
--- fdlibm.h	1999/06/24 20:41:47	1.2
+++ fdlibm.h	2000/01/10 19:44:27
@@ -2,7 +2,7 @@
 /* @(#)fdlibm.h 5.1 93/09/24 */
 /*
  * ====================================================
- * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
+ * Copyright (C) 1993, 2000 by Sun Microsystems, Inc. All rights reserved.
  *
  * Developed at SunPro, a Sun Microsystems, Inc. business.
  * Permission to use, copy, modify, and distribute this
@@ -12,10 +12,6 @@
  */
 
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <config.h>
 #include <stdlib.h>
 
@@ -47,6 +43,10 @@
 /* These typedefs are true for the targets running Java. */
 
 #define _IEEE_LIBM
+
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /*
  * ANSI/POSIX
Index: java/lang/mprec.h
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/mprec.h,v
retrieving revision 1.3
diff -u -r1.3 mprec.h
--- mprec.h	1999/07/12 09:40:07	1.3
+++ mprec.h	2000/01/10 19:44:32
@@ -2,7 +2,7 @@
  *
  * The author of this software is David M. Gay.
  *
- * Copyright (c) 1991 by AT&T.
+ * Copyright (c) 1991, 2000 by AT&T.
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose without fee is hereby granted, provided that this entire notice
@@ -26,10 +26,6 @@
 	dmg@research.att.com or research!dmg
  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
 #include <config.h>
 #include "ieeefp.h"
 
@@ -51,6 +47,9 @@
 #include <sys/config.h>
 #endif
 
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /* ISO C9X int type declarations */
 
Index: java/lang/natMath.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natMath.cc,v
retrieving revision 1.2
diff -u -r1.2 natMath.cc
--- natMath.cc	1999/09/10 22:03:08	1.2
+++ natMath.cc	2000/01/10 19:44:32
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999  Cygnus Solutions
+/* Copyright (C) 1998, 1999, 2000  Cygnus Solutions
 
    This file is part of libgcj.
 
@@ -59,7 +59,7 @@
 
 jdouble java::lang::Math::atan2(jdouble y, jdouble x)
 {
-  return (jdouble)::atan2((jdouble)y, (jdouble)x);
+  return (jdouble)::atan2((double)y, (double)x);
 }  
 
 jdouble java::lang::Math::log(jdouble x)
@@ -79,12 +79,12 @@
 
 jdouble java::lang::Math::pow(jdouble y, jdouble x)
 {
-  return (jdouble)::pow((jdouble)y, (jdouble)x);
+  return (jdouble)::pow((double)y, (double)x);
 }  
 
 jdouble java::lang::Math::IEEEremainder(jdouble y, jdouble x)
 {
-  return (jdouble)::__ieee754_remainder((jdouble)y, (jdouble)x);
+  return (jdouble)::__ieee754_remainder((double)y, (double)x);
 }  
 
 jdouble java::lang::Math::abs(jdouble x)


More information about the Java-patches mailing list