changeset 3067:aa76250a5b87

[project @ 1997-07-02 21:54:12 by jwe]
author jwe
date Wed, 02 Jul 1997 21:54:21 +0000
parents 2d485faf2fa3
children 17e2f90e0d3b
files src/ChangeLog src/Makefile.in src/matherr.c src/sysdep.cc
diffstat 4 files changed, 70 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+Wed Jul  2 16:47:09 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
+
+	* matherr.c: New file.  Move matherr function here.
+	* sysdep.cc: From here.
+	* Makefile.in (DIST_SRC): Add matherr.c to the list.
+
+	* error.cc (handle_message): Avoid bug in g++ snapshot.
+
 Thu Jun 26 22:04:09 1997  John W. Eaton  <jwe@bevo.che.wisc.edu>
 
 	* utils.cc (file_in_path): Add default load path to PATH arg if
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -120,8 +120,8 @@
 DIST_SRC := BaseSLList.cc Map.cc SLList.cc SLStack.cc Stack.cc \
 	data.cc defaults.cc defun.cc dirfns.cc dynamic-ld.cc \
 	error.cc file-io.cc fn-cache.cc gripes.cc help.cc input.cc \
-	lex.l load-save.cc mappers.cc oct-fstrm.cc oct-hist.cc \
-	oct-iostrm.cc oct-map.cc oct-obj.cc oct-prcstrm.cc \
+	lex.l load-save.cc mappers.cc matherr.c oct-fstrm.cc \
+	oct-hist.cc oct-iostrm.cc oct-map.cc oct-obj.cc oct-prcstrm.cc \
 	oct-procbuf.cc oct-stdstrm.cc oct-stream.cc oct-strstrm.cc \
 	oct-lvalue.cc pager.cc parse.y pr-output.cc procstream.cc \
 	sighandlers.cc strcasecmp.c strncase.c strfns.cc \
new file mode 100644
--- /dev/null
+++ b/src/matherr.c
@@ -0,0 +1,60 @@
+/*
+
+Copyright (C) 1997 John W. Eaton
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "oct-math.h"
+
+#if defined (EXCEPTION_IN_MATH)
+int
+matherr (struct exception *x)
+{
+  /* Possibly print our own message someday.  Should probably be
+     user-switchable. */
+
+  switch (x->type)
+    {
+    case DOMAIN:
+    case SING:
+    case OVERFLOW:
+    case UNDERFLOW:
+    case TLOSS:
+    case PLOSS:
+    default:
+      break;
+    }
+
+  /* But don't print the system message. */
+
+  return 1;
+}
+#endif
+
+#endif
+
+/*
+;;; Local Variables: ***
+;;; mode: C ***
+;;; End: ***
+*/
--- a/src/sysdep.cc
+++ b/src/sysdep.cc
@@ -136,34 +136,6 @@
 }
 #endif
 
-// XXX FIXME XXX -- some systems define struct __exception.
-
-#if defined (EXCEPTION_IN_MATH)
-extern "C"
-int
-matherr (struct exception *x)
-{
-  // Possibly print our own message someday.  Should probably be
-  // user-switchable.
-
-  switch (x->type)
-    {
-    case DOMAIN:
-    case SING:
-    case OVERFLOW:
-    case UNDERFLOW:
-    case TLOSS:
-    case PLOSS:
-    default:
-      break;
-    }
-
-  // But don't print the system message.
-
-  return 1;
-}
-#endif
-
 void
 sysdep_init (void)
 {