changeset 9441:160c564d5d25

initialize floating point values properly for NetBSD systems
author Aleksej Saushev <asau@inbox.ru>
date Mon, 20 Jul 2009 15:55:33 -0400
parents 357cff83985d
children 2d73b19c5507
files doc/ChangeLog doc/interpreter/contributors.in liboctave/ChangeLog liboctave/lo-ieee.cc src/ChangeLog src/sysdep.cc
diffstat 6 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/doc/ChangeLog	Mon Jul 20 11:51:10 2009 +0200
+++ b/doc/ChangeLog	Mon Jul 20 15:55:33 2009 -0400
@@ -1,3 +1,7 @@
+2009-07-20  John W. Eaton  <jwe@octave.org>
+
+	* interpreter/contributors.in: Add Aleksej Saushev.
+
 2009-06-24  Rafael Laboissiere  <rafael@debian.org>
 
 	* Makefile.in (dist): Drop conf.texi as prerequisite.
--- a/doc/interpreter/contributors.in	Mon Jul 20 11:51:10 2009 +0200
+++ b/doc/interpreter/contributors.in	Mon Jul 20 15:55:33 2009 -0400
@@ -183,6 +183,7 @@
 Juhani Saastamoinen
 Radek Salac
 Ben Sapp
+Aleksej Saushev
 Alois Schloegl
 Michel D. Schmid
 Julian Schnidder
--- a/liboctave/ChangeLog	Mon Jul 20 11:51:10 2009 +0200
+++ b/liboctave/ChangeLog	Mon Jul 20 15:55:33 2009 -0400
@@ -1,3 +1,8 @@
+2009-07-20  John W. Eaton  <jwe@octave.org>
+
+	* lo-ieee.cc (octave_ieee_init) [__NetBSD__]: Call nan to
+	initialize Octave_NaN and nanf, to initialize Octave_Float_NaN.
+
 2009-07-11  John W. Eaton  <jwe@octave.org>
 
 	* file-ops.cc (file_ops::symlink, file_ops::readlink):
--- a/liboctave/lo-ieee.cc	Mon Jul 20 11:51:10 2009 +0200
+++ b/liboctave/lo-ieee.cc	Mon Jul 20 15:55:33 2009 -0400
@@ -93,6 +93,8 @@
 #if defined (__alpha__) && defined (__osf__)
 	extern unsigned int DQNAN[2];
 	octave_NaN = (*(X_CAST(double *, DQNAN)));
+#elif defined (__NetBSD__)
+	octave_NaN = nan ("");
 #else
 	octave_NaN = tmp_inf / tmp_inf;
         // try to ensure that lo_ieee_sign gives false for a NaN.
@@ -139,7 +141,11 @@
 	  }
 #endif
 
+#if defined (__NetBSD__)
+	octave_Float_NaN = nanf ("");
+#else
 	octave_Float_NaN = float_tmp_inf / float_tmp_inf;
+#endif
 	octave_Float_Inf = float_tmp_inf;
 
 	lo_ieee_float tf;
--- a/src/ChangeLog	Mon Jul 20 11:51:10 2009 +0200
+++ b/src/ChangeLog	Mon Jul 20 15:55:33 2009 -0400
@@ -1,3 +1,8 @@
+2009-07-20  Aleksej Saushev  <asau@inbox.ru>
+
+	* sysdep.cc: Also define BSD_init if __NetBSD__ is defined.
+	(sysdep_init): Also call BSD_init if __NetBSD__ is defined.
+
 2009-07-20  Jaroslav Hajek  <highegg@gmail.com>
 
 	* bitfcns.cc (DO_UBITSHIFT): Avoid overflow.
--- a/src/sysdep.cc	Mon Jul 20 11:51:10 2009 +0200
+++ b/src/sysdep.cc	Mon Jul 20 15:55:33 2009 -0400
@@ -95,7 +95,7 @@
 #define STDIN_FILENO 1
 #endif
 
-#if defined (__386BSD__) || defined (__FreeBSD__)
+#if defined (__386BSD__) || defined (__FreeBSD__) || defined (__NetBSD__)
 static void
 BSD_init (void)
 {
@@ -300,7 +300,7 @@
 void
 sysdep_init (void)
 {
-#if defined (__386BSD__) || defined (__FreeBSD__)
+#if defined (__386BSD__) || defined (__FreeBSD__) || defined(__NetBSD__)
   BSD_init ();
 #elif defined (__MINGW32__)
   MINGW_init ();