summaryrefslogtreecommitdiff
path: root/eval_intern.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-05 07:10:21 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-10-05 07:10:21 (GMT)
commit8b4cf7b7081bbd2d6dd42f3163f5da2cec34689d (patch)
treed405109ea7bf2813875145a376abefd8398c0b5a /eval_intern.h
parent57149f76eb7b8bb7ae299164ea5f332729fcb5a2 (diff)
eval_intern.h: pass_passed_block
* eval_intern.h (pass_passed_block): make helper inline function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r--eval_intern.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/eval_intern.h b/eval_intern.h
index 4d23d4e..6b5ca7f 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -4,15 +4,14 @@
#include "ruby/ruby.h"
#include "vm_core.h"
-#define PASS_PASSED_BLOCK_TH(th) do { \
- (th)->passed_block = rb_vm_control_frame_block_ptr(th->cfp); \
- (th)->cfp->flag |= VM_FRAME_FLAG_PASSED; \
-} while (0)
-
-#define PASS_PASSED_BLOCK() do { \
- rb_thread_t * const __th__ = GET_THREAD(); \
- PASS_PASSED_BLOCK_TH(__th__); \
-} while (0)
+static inline void
+pass_passed_block(rb_thread_t *th)
+{
+ th->passed_block = rb_vm_control_frame_block_ptr(th->cfp);
+ th->cfp->flag |= VM_FRAME_FLAG_PASSED;
+}
+#define PASS_PASSED_BLOCK_TH(th) pass_passed_block(th)
+#define PASS_PASSED_BLOCK() pass_passed_block(GET_THREAD())
#ifdef HAVE_STDLIB_H
#include <stdlib.h>