diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2009-11-17 14:12:30 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2009-11-17 14:12:30 -0800 |
commit | eec7d1dea908432cc2ec9337cd3e0f63b72c16d9 (patch) | |
tree | c4c248db2f518d367b6cb6996677ec064847dafa /unwind.h | |
parent | 07e0c300bc1a4c310080d0b2c21fdc863778115e (diff) | |
download | txr-eec7d1dea908432cc2ec9337cd3e0f63b72c16d9.tar.gz txr-eec7d1dea908432cc2ec9337cd3e0f63b72c16d9.tar.bz2 txr-eec7d1dea908432cc2ec9337cd3e0f63b72c16d9.zip |
Fixes for compliance to C89.
Diffstat (limited to 'unwind.h')
-rw-r--r-- | unwind.h | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -31,9 +31,7 @@ #endif typedef union uw_frame uw_frame_t; -typedef enum uw_frtype uw_frtype_t; - -enum uw_frtype { UW_BLOCK, UW_ENV, UW_CATCH }; +typedef enum uw_frtype { UW_BLOCK, UW_ENV, UW_CATCH } uw_frtype_t; struct uw_common { uw_frame_t *up; @@ -91,32 +89,34 @@ noreturn obj_t *type_mismatch(obj_t *, ...); #define uw_block_begin(TAG, RESULTVAR) \ obj_t *RESULTVAR = nil; \ + do \ { \ uw_frame_t uw_blk; \ uw_push_block(&uw_blk, TAG); \ if (setjmp(uw_blk.bl.jb)) { \ RESULTVAR = uw_blk.bl.result; \ - } else { + } else { \ + typedef int uw_d_u_m_m_y #define uw_block_end \ } \ uw_pop_frame(&uw_blk); \ - } + } while (0) #define uw_env_begin \ - { \ + do { \ uw_frame_t uw_env; \ uw_push_env(&uw_env) #define uw_env_end \ uw_pop_frame(&uw_env); \ - } + } while (0) #define uw_catch_begin(MATCHES, SYMVAR, \ EXCVAR) \ obj_t *SYMVAR = nil; \ obj_t *EXCVAR = nil; \ - { \ + do { \ uw_frame_t uw_catch; \ uw_push_catch(&uw_catch, MATCHES); \ switch (setjmp(uw_catch.ca.jb)) { \ @@ -129,7 +129,7 @@ noreturn obj_t *type_mismatch(obj_t *, ...); break; \ case 2: \ EXCVAR = uw_catch.ca.exception; \ - SYMVAR = uw_catch.ca.sym; \ + SYMVAR = uw_catch.ca.sym; #define uw_unwind \ break; \ @@ -144,7 +144,7 @@ noreturn obj_t *type_mismatch(obj_t *, ...); uw_continue(&uw_catch, \ uw_catch.ca.cont); \ uw_pop_frame(&uw_catch); \ - } + } while(0) #define internal_error(STR) \ do { \ |