From 4b8cb23a365f4d8dafc51a3b92e2b99c38a18623 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 5 Nov 2014 08:20:31 +0000 Subject: [PATCH] intern.h: deprecate disable and enable super * include/ruby/intern.h (rb_disable_super, rb_enable_super): warn as deprecated at build time, instead of ignoring silently or warning at runtime only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48283 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ include/ruby/intern.h | 14 ++++++++++++-- vm_method.c | 15 --------------- 3 files changed, 18 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80df3691b1..e5d914c596 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Nov 5 17:20:29 2014 Nobuyoshi Nakada + + * include/ruby/intern.h (rb_disable_super, rb_enable_super): warn + as deprecated at build time, instead of ignoring silently or + warning at runtime only. + Wed Nov 5 16:55:52 2014 Nobuyoshi Nakada * proc.c (rb_f_lambda): remove deprecated function, which has been diff --git a/include/ruby/intern.h b/include/ruby/intern.h index f34fcef93b..b10c9c6467 100644 --- a/include/ruby/intern.h +++ b/include/ruby/intern.h @@ -371,8 +371,18 @@ VALUE rb_f_exit(int, const VALUE*); VALUE rb_f_abort(int, const VALUE*); void rb_remove_method(VALUE, const char*); void rb_remove_method_id(VALUE, ID); -#define rb_disable_super(klass, name) ((void)0) -#define rb_enable_super(klass, name) ((void)0) +DEPRECATED(static inline void rb_disable_super(void)); +DEPRECATED(static inline void rb_enable_super(void)); +static inline void rb_disable_super(void) +{ + /* obsolete - no use */ +} +static inline void rb_enable_super(void) +{ + rb_warning("rb_enable_super() is obsolete"); +} +#define rb_disable_super(klass, name) rb_disable_super() +#define rb_enable_super(klass, name) rb_enable_super() #define HAVE_RB_DEFINE_ALLOC_FUNC 1 typedef VALUE (*rb_alloc_func_t)(VALUE); void rb_define_alloc_func(VALUE, rb_alloc_func_t); diff --git a/vm_method.c b/vm_method.c index da77331344..b722d050e1 100644 --- a/vm_method.c +++ b/vm_method.c @@ -814,21 +814,6 @@ rb_mod_remove_method(int argc, VALUE *argv, VALUE mod) return mod; } -#undef rb_disable_super -#undef rb_enable_super - -void -rb_disable_super(VALUE klass, const char *name) -{ - /* obsolete - no use */ -} - -void -rb_enable_super(VALUE klass, const char *name) -{ - rb_warning("rb_enable_super() is obsolete"); -} - static void rb_export_method(VALUE klass, ID name, rb_method_flag_t noex) {