aboutsummaryrefslogtreecommitdiffstats
path: root/method.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-12 08:18:10 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-12 08:18:10 +0000
commita11e25432bf68d87528537b0717f6f13519622eb (patch)
tree900f68e4f28b4eb59dcc050848788825885364d9 /method.h
parent1abd51ad910ded964b5e6db984517974838f3850 (diff)
downloadruby-a11e25432bf68d87528537b0717f6f13519622eb.tar.gz
method.h: UNDEFINED_REFINED_METHOD_P
* method.h (UNDEFINED_REFINED_METHOD_P): macro to tell if refined original method is defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'method.h')
-rw-r--r--method.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/method.h b/method.h
index 82678092c2..25d73be65f 100644
--- a/method.h
+++ b/method.h
@@ -108,6 +108,9 @@ struct unlinked_method_entry_list_entry {
};
#define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF)
+#define UNDEFINED_REFINED_METHOD_P(def) \
+ ((def)->type == VM_METHOD_TYPE_REFINED && \
+ UNDEFINED_METHOD_ENTRY_P((def)->body.orig_me))
void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex);
rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_flag_t noex);