diff options
author | Richard Stallman <rms@gnu.org> | 1992-10-21 21:20:41 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1992-10-21 21:20:41 +0000 |
commit | bff4b641c72b8be9b21fceb589f10ee337e55cfb (patch) | |
tree | d5ade745455c4864c8ad5c7e50aa3df0ed3aab01 /gcc/toplev.c | |
parent | 210d97af17e50d50b7d55c2c49bfbbe2cdf4a561 (diff) | |
download | gcc-bff4b641c72b8be9b21fceb589f10ee337e55cfb.zip gcc-bff4b641c72b8be9b21fceb589f10ee337e55cfb.tar.gz gcc-bff4b641c72b8be9b21fceb589f10ee337e55cfb.tar.bz2 |
(push_float_handler, pop_float_handler): New functions.
From-SVN: r2543
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r-- | gcc/toplev.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c index 9610b88..e92b7c8 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 |