# HG changeset patch # User jwe # Date 867880461 0 # Node ID aa76250a5b875baa0643d68204aac79bab547470 # Parent 2d485faf2fa3cbeb4794ba594021207da669b20b [project @ 1997-07-02 21:54:12 by jwe] diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +Wed Jul 2 16:47:09 1997 John W. Eaton + + * 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 * utils.cc (file_in_path): Add default load path to PATH arg if diff --git a/src/Makefile.in b/src/Makefile.in --- 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 \ diff --git a/src/matherr.c b/src/matherr.c 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 +#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: *** +*/ diff --git a/src/sysdep.cc b/src/sysdep.cc --- 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) {