diff options
author | Bill Meier <wmeier@newsguy.com> | 2012-12-04 14:37:21 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2012-12-04 14:37:21 +0000 |
commit | 357ea3fc88d43fb5a9c373bbcf1ad73b79f718e2 (patch) | |
tree | b8fc6c7b9b497986ff0198ec2e1649629f13ed74 /epan/except.h | |
parent | 1c25482ebc25c1ebb3625734994ded22058e7faa (diff) | |
download | wireshark-357ea3fc88d43fb5a9c373bbcf1ad73b79f718e2.tar.gz wireshark-357ea3fc88d43fb5a9c373bbcf1ad73b79f718e2.tar.bz2 wireshark-357ea3fc88d43fb5a9c373bbcf1ad73b79f718e2.zip |
Define variants of CLEANUP_PUSH & etc to allow nested use w/o "shadowing" variables.
svn path=/trunk/; revision=46366
Diffstat (limited to 'epan/except.h')
-rw-r--r-- | epan/except.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/epan/except.h b/epan/except.h index 407be9d83c..68fa58e7fc 100644 --- a/epan/except.h +++ b/epan/except.h @@ -143,6 +143,29 @@ extern void except_free(void *); except_cl.except_func(except_cl.except_context); \ } + +/* --- Variants to allow nesting of except_cleanup_push w/o "shadowing" variables */ +#define except_cleanup_push_pfx(pfx, F, C) \ + { \ + struct except_stacknode pfx##_except_sn; \ + struct except_cleanup pfx##_except_cl; \ + except_setup_clean(&pfx##_except_sn, &pfx##_except_cl, F, C) + +#define except_cleanup_pop_pfx(pfx, E) \ + except_pop(); \ + if (E) \ + pfx##_except_cl.except_func(pfx##_except_cl.except_context);\ + } + +#define except_checked_cleanup_pop_pfx(pfx, F, E) \ + except_pop(); \ + assert (pfx##_except_cl.except_func == (F)); \ + if (E) \ + pfx##_except_cl.except_func(pfx##_except_cl.except_context);\ + } +/* ---------- */ + + #define except_try_push(ID, NUM, PPE) \ { \ struct except_stacknode except_sn; \ |