aboutsummaryrefslogtreecommitdiffstats
path: root/class.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-08-29 10:45:09 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-08-29 18:34:09 +0900
commit9b429eb3b15321115d9a217c91c5510fe43777a7 (patch)
tree08c050a9c241a8b068a131754dc29bee72a974bc /class.c
parent0b81e7d6e2810adac081965f0da1d8064888c0bd (diff)
downloadruby-9b429eb3b15321115d9a217c91c5510fe43777a7.tar.gz
drop-in type check for rb_define_protected_method
We can check the function pointer passed to rb_define_protected_method like how we do so in rb_define_method. This changeset revealed no prototypes mismatches.
Diffstat (limited to 'class.c')
-rw-r--r--class.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/class.c b/class.c
index c89af22c47..809bfd8c9d 100644
--- a/class.c
+++ b/class.c
@@ -1552,6 +1552,9 @@ rb_define_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc
rb_add_method_cfunc(klass, rb_intern(name), func, argc, METHOD_VISI_PUBLIC);
}
+#ifdef rb_define_protected_method
+#undef rb_define_protected_method
+#endif
void
rb_define_protected_method(VALUE klass, const char *name, VALUE (*func)(ANYARGS), int argc)
{