From: Richard Stallman Date: Wed, 21 Oct 1992 21:20:41 +0000 (+0000) Subject: (push_float_handler, pop_float_handler): New functions. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bff4b641c72b8be9b21fceb589f10ee337e55cfb;p=gcc.git (push_float_handler, pop_float_handler): New functions. From-SVN: r2543 --- diff --git a/gcc/toplev.c b/gcc/toplev.c index 9610b881c28..e92b7c80915 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1360,6 +1360,36 @@ set_float_handler (handler) bcopy (handler, float_handler, sizeof (float_handler)); } +/* Specify, in HANDLER, where to longjmp to when a floating arithmetic + error happens, pushing the previous specification into OLD_HANDLER. + Return an indication of whether there was a previous handler in effect. */ + +int +push_float_handler (handler, old_handler) + jmp_buf handler; +{ + int was_handled = float_handled; + + float_handled = 1; + if (was_handled) + bcopy (float_handler, old_handler, sizeof (float_handler)); + bcopy (handler, float_handler, sizeof (float_handler)); + return was_handled; +} + +/* Restore the previous specification of whether and where to longjmp to + when a floating arithmetic error happens. */ + +void +pop_float_handler (handled, handler) + int handled; + jmp_buf handler; +{ + float_handled = handled; + if (handled) + bcopy (handler, float_handler, sizeof (float_handler)); +} + /* Signals actually come here. */ static void