Mercurial > hg > octave-lyh
changeset 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 | 587d268cf64e |
files | src/ChangeLog src/pt-eval.cc |
diffstat | 2 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-06-24 Jaroslav Hajek <highegg@gmail.com> + + * pt-eval.cc (do_unwind_protect_cleanup_code): + Workaround sig_atomic_t != int. + 2009-06-23 Jaroslav Hajek <highegg@gmail.com> * quit.h (octave_quit_exception): Delete.
--- 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,