From 9b429eb3b15321115d9a217c91c5510fe43777a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?= Date: Thu, 29 Aug 2019 10:45:09 +0900 Subject: 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. --- class.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'class.c') 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) { -- cgit v1.2.3