(push_float_handler, pop_float_handler): New functions.
authorRichard Stallman <rms@gnu.org>
Wed, 21 Oct 1992 21:20:41 +0000 (21:20 +0000)
committerRichard Stallman <rms@gnu.org>
Wed, 21 Oct 1992 21:20:41 +0000 (21:20 +0000)
From-SVN: r2543

gcc/toplev.c

index 9610b881c288db3a0067988ad89fb28137ece402..e92b7c80915978a81721febe8ff901014a7c6ad8 100644 (file)
@@ -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