aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-21 05:17:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-21 05:17:41 +0000
commit8acbd4de1824a68be5bffb97a6d9857fc85cb9e4 (patch)
tree7da8cff205ed6ad16c8cf188b190aedcb12fe33c
parent896b4030f6f663ac338b5c7e40f52ac202423695 (diff)
downloadruby-8acbd4de1824a68be5bffb97a6d9857fc85cb9e4.tar.gz
backward.h: 2.2 deprecated features
* include/ruby/backward.h (DECLARE_DEPRECATED_FEATURE): move features deprecated at 2.2. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--hash.c12
-rw-r--r--include/ruby/backward.h20
-rw-r--r--include/ruby/intern.h22
-rw-r--r--pack.c12
-rw-r--r--struct.c6
-rw-r--r--vm.c7
-rw-r--r--vm_method.c6
7 files changed, 20 insertions, 65 deletions
diff --git a/hash.c b/hash.c
index bec9c8522b..4b76d0282f 100644
--- a/hash.c
+++ b/hash.c
@@ -84,12 +84,6 @@ static VALUE envtbl;
static ID id_hash, id_yield, id_default, id_flatten_bang;
VALUE
-rb_hash_ifnone(VALUE h)
-{
- return RHASH_IFNONE(h);
-}
-
-VALUE
rb_hash_set_ifnone(VALUE hash, VALUE ifnone)
{
RB_OBJ_WRITE(hash, (&RHASH(hash)->ifnone), ifnone);
@@ -266,12 +260,6 @@ rb_obj_hash(VALUE obj)
return ST2FIX(hnum);
}
-int
-rb_hash_iter_lev(VALUE h)
-{
- return RHASH_ITER_LEV(h);
-}
-
static const struct st_hash_type objhash = {
rb_any_cmp,
rb_any_hash,
diff --git a/include/ruby/backward.h b/include/ruby/backward.h
index 4574cb98da..2a92df38d2 100644
--- a/include/ruby/backward.h
+++ b/include/ruby/backward.h
@@ -1,6 +1,26 @@
#ifndef RUBY_RUBY_BACKWARD_H
#define RUBY_RUBY_BACKWARD_H 1
+#define DECLARE_DEPRECATED_FEATURE(ver, func) \
+ NORETURN(ERRORFUNC(("deprecated since "#ver), DEPRECATED(void func(void))))
+
+/* eval.c */
+DECLARE_DEPRECATED_FEATURE(2.2, rb_disable_super);
+DECLARE_DEPRECATED_FEATURE(2.2, rb_enable_super);
+
+/* hash.c */
+DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_iter_lev);
+DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_ifnone);
+
+/* string.c */
+DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associate);
+DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associated);
+
+/* vm.c */
+DECLARE_DEPRECATED_FEATURE(2.2, rb_clear_cache);
+DECLARE_DEPRECATED_FEATURE(2.2, rb_frame_pop);
+
+/* from version.c */
#ifndef RUBY_SHOW_COPYRIGHT_TO_DIE
# define RUBY_SHOW_COPYRIGHT_TO_DIE 1
#endif
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index efa8f4058c..2f6afaa0c3 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -371,24 +371,11 @@ NORETURN(VALUE rb_f_exit(int, const VALUE*));
NORETURN(VALUE rb_f_abort(int, const VALUE*));
void rb_remove_method(VALUE, const char*);
void rb_remove_method_id(VALUE, ID);
-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);
void rb_undef_alloc_func(VALUE);
rb_alloc_func_t rb_get_alloc_func(VALUE);
-NORETURN(DEPRECATED(void rb_clear_cache(void)));
void rb_clear_constant_cache(void);
void rb_clear_method_cache_by_class(VALUE);
void rb_alias(VALUE, ID, ID);
@@ -527,8 +514,6 @@ int rb_path_check(const char*);
int rb_env_path_tainted(void);
VALUE rb_env_clear(void);
VALUE rb_hash_size(VALUE);
-DEPRECATED(int rb_hash_iter_lev(VALUE));
-DEPRECATED(VALUE rb_hash_ifnone(VALUE));
/* io.c */
#define rb_defout rb_stdout
RUBY_EXTERN VALUE rb_fs;
@@ -777,8 +762,6 @@ VALUE rb_str_replace(VALUE, VALUE);
VALUE rb_str_inspect(VALUE);
VALUE rb_str_dump(VALUE);
VALUE rb_str_split(VALUE, const char*);
-NORETURN(DEPRECATED(void rb_str_associate(VALUE, VALUE)));
-NORETURN(DEPRECATED(VALUE rb_str_associated(VALUE)));
void rb_str_setter(VALUE, ID, VALUE*);
VALUE rb_str_intern(VALUE);
VALUE rb_sym_to_s(VALUE);
@@ -886,7 +869,6 @@ VALUE rb_struct_getmember(VALUE, ID);
VALUE rb_struct_s_members(VALUE);
VALUE rb_struct_members(VALUE);
VALUE rb_struct_size(VALUE s);
-DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
VALUE rb_struct_alloc_noinit(VALUE);
VALUE rb_struct_define_without_accessor(const char *, VALUE, rb_alloc_func_t, ...);
VALUE rb_struct_define_without_accessor_under(VALUE outer, const char *class_name, VALUE super, rb_alloc_func_t alloc, ...);
@@ -973,10 +955,6 @@ int rb_frame_method_id_and_class(ID *idp, VALUE *klassp);
VALUE rb_make_backtrace(void);
VALUE rb_make_exception(int, const VALUE*);
-/* deprecated */
-NORETURN(DEPRECATED(void rb_frame_pop(void)));
-
-
RUBY_SYMBOL_EXPORT_END
#if defined(__cplusplus)
diff --git a/pack.c b/pack.c
index 4dd5b2386f..d2f67c73f2 100644
--- a/pack.c
+++ b/pack.c
@@ -126,18 +126,6 @@ str_associated(VALUE str)
return rb_ivar_lookup(str, id_associated, Qfalse);
}
-void
-rb_str_associate(VALUE str, VALUE add)
-{
- DEPRECATED_INTERNAL_FEATURE("rb_str_associate()");
-}
-
-VALUE
-rb_str_associated(VALUE str)
-{
- DEPRECATED_INTERNAL_FEATURE("rb_str_associated()");
-}
-
/*
* call-seq:
* arr.pack( aTemplateString ) -> aBinaryString
diff --git a/struct.c b/struct.c
index 6303436122..77b81b45ac 100644
--- a/struct.c
+++ b/struct.c
@@ -1126,12 +1126,6 @@ rb_struct_size(VALUE s)
return LONG2FIX(RSTRUCT_LEN(s));
}
-const VALUE*
-rb_struct_ptr(VALUE s)
-{
- return RSTRUCT_CONST_PTR(s);
-}
-
/*
* call-seq:
* struct.dig(key, ...) -> object
diff --git a/vm.c b/vm.c
index 5b1238a4b8..c542546309 100644
--- a/vm.c
+++ b/vm.c
@@ -544,13 +544,6 @@ rb_vm_rewind_cfp(rb_thread_t *th, rb_control_frame_t *cfp)
}
}
-/* obsolete */
-void
-rb_frame_pop(void)
-{
- DEPRECATED_INTERNAL_FEATURE("rb_frame_pop()");
-}
-
/* at exit */
void
diff --git a/vm_method.c b/vm_method.c
index dd5b921d7e..00b2763e5d 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -81,12 +81,6 @@ rb_class_clear_method_cache(VALUE klass, VALUE arg)
}
void
-rb_clear_cache(void)
-{
- DEPRECATED_INTERNAL_FEATURE("rb_clear_cache()");
-}
-
-void
rb_clear_constant_cache(void)
{
INC_GLOBAL_CONSTANT_STATE();