diff src/pt-eval.cc @ 12012:664597f88284 release-3-2-x

workaround sig_atomic_t != int in pt-eval.cc
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 24 Jun 2009 07:40:21 +0200
parents 67ad3b58b99a
children 356268e4ad37
line wrap: on
line diff
--- a/src/pt-eval.cc
+++ b/src/pt-eval.cc
@@ -904,12 +904,18 @@
     }
 }
 
+void restore_interrupt_state (void *ptr)
+{
+  octave_interrupt_state = *(reinterpret_cast<sig_atomic_t *> (ptr));
+}
+
 static void
 do_unwind_protect_cleanup_code (void *ptr)
 {
   tree_statement_list *list = static_cast<tree_statement_list *> (ptr);
 
-  unwind_protect_int (octave_interrupt_state);
+  sig_atomic_t saved_octave_interrupt_state = octave_interrupt_state;
+  unwind_protect::add (restore_interrupt_state, &saved_octave_interrupt_state);
   octave_interrupt_state = 0;
 
   // We want to run the cleanup code without error_state being set,