summaryrefslogtreecommitdiff
path: root/rubysig.h
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-16 07:24:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-11-16 07:24:21 +0000
commit074203d270bba2046f6d272f9d01385257be9fee (patch)
treee4ece206c3afe82313f3faa4a82468cdfb32d2f5 /rubysig.h
parent46620a87720943120cabe6ffe2e94a2c3506c4c2 (diff)
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'rubysig.h')
-rw-r--r--rubysig.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/rubysig.h b/rubysig.h
index 88b3083..1975215 100644
--- a/rubysig.h
+++ b/rubysig.h
@@ -37,8 +37,12 @@ typedef int rb_atomic_t;
# define ATOMIC_INC(var) (++(var))
# define ATOMIC_DEC(var) (--(var))
-# define TRAP_BEG (rb_trap_immediate=1)
-# define TRAP_END (rb_trap_immediate=0)
+# define TRAP_BEG do {\
+ int trap_immediate = rb_trap_immediate;\
+ rb_trap_immediate = 1;
+# define TRAP_END rb_trap_immediate = trap_immediate;\
+} while (0)
+
# define RUBY_CRITICAL(statements) do {\
int trap_immediate = rb_trap_immediate;\
rb_trap_immediate = 0;\