summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-30 20:56:10 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-12-30 23:11:09 +0900
commit0284e7ca62e55c160c84d3471e64765e612788ec (patch)
tree724d806eb767e5f06abf668a5fa9a4c4a6231e79 /include
parentac2df89113d6ead77032aaa21cf2b0253c8975db (diff)
Replaced deprecation macros
* DECLARE_DEPRECATED_FEATURE with RBIMPL_ATTR_DEPRECATED_SINCE * DECLARE_DEPRECATED_INTERNAL_FEATURE with RBIMPL_ATTR_INTERNAL And moved function declarations outside both.
Diffstat (limited to 'include')
-rw-r--r--include/ruby/backward.h49
1 files changed, 21 insertions, 28 deletions
diff --git a/include/ruby/backward.h b/include/ruby/backward.h
index 350a58ee95..34efaefa81 100644
--- a/include/ruby/backward.h
+++ b/include/ruby/backward.h
@@ -12,60 +12,53 @@
#include "ruby/internal/interpreter.h"
#include "ruby/backward/2/attributes.h"
-#define DECLARE_DEPRECATED_FEATURE(ver, func) \
- NORETURN(ERRORFUNC(("deprecated since "#ver), DEPRECATED(void func(void))))
+#define RBIMPL_ATTR_DEPRECATED_SINCE(ver) RBIMPL_ATTR_DEPRECATED(("since " #ver))
+#define RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED(("internal function"))
/* eval.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_disable_super);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_enable_super);
+RBIMPL_ATTR_DEPRECATED_SINCE(2.2) void rb_disable_super();
+RBIMPL_ATTR_DEPRECATED_SINCE(2.2) void rb_enable_super();
/* hash.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_iter_lev);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_ifnone);
+RBIMPL_ATTR_DEPRECATED_SINCE(2.2) void rb_hash_iter_lev();
+RBIMPL_ATTR_DEPRECATED_SINCE(2.2) void rb_hash_ifnone();
/* string.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associate);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associated);
+RBIMPL_ATTR_DEPRECATED_SINCE(2.2) void rb_str_associate();
+RBIMPL_ATTR_DEPRECATED_SINCE(2.2) void rb_str_associated();
/* variable.c */
-DEPRECATED(void rb_autoload(VALUE, ID, const char*));
-
-/* vm.c */
-DECLARE_DEPRECATED_FEATURE(2.2, rb_clear_cache);
-DECLARE_DEPRECATED_FEATURE(2.2, rb_frame_pop);
-
-#define DECLARE_DEPRECATED_INTERNAL_FEATURE(func) \
- NORETURN(ERRORFUNC(("deprecated internal function"), DEPRECATED(void func(void))))
+RBIMPL_ATTR_DEPRECATED_SINCE(2.5) void rb_autoload();
/* eval.c */
-NORETURN(ERRORFUNC(("internal function"), void rb_frozen_class_p(VALUE)));
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_exec_end_proc);
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.6) void rb_frozen_class_p();
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.7) void rb_exec_end_proc();
/* error.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error);
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error_with_enc);
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error_append);
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.3) void rb_compile_error();
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.3) void rb_compile_error_with_enc();
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.3) void rb_compile_error_append();
/* gc.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_gc_call_finalizer_at_exit);
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.7) void rb_gc_call_finalizer_at_exit();
/* signal.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_trap_exit);
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.7) void rb_trap_exit();
/* struct.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_struct_ptr);
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.4) void rb_struct_ptr();
/* thread.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_clear_trace_func);
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.7) void rb_clear_trace_func();
/* variable.c */
-DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_generic_ivar_table);
-NORETURN(ERRORFUNC(("internal function"), VALUE rb_mod_const_missing(VALUE, VALUE)));
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.7) void rb_generic_ivar_table();
+RBIMPL_ATTR_INTERNAL() RBIMPL_ATTR_DEPRECATED_SINCE(2.6) VALUE rb_mod_const_missing(VALUE, VALUE);
/* from version.c */
#if defined(RUBY_SHOW_COPYRIGHT_TO_DIE) && !!(RUBY_SHOW_COPYRIGHT_TO_DIE+0)
/* for source code backward compatibility */
-RBIMPL_ATTR_DEPRECATED(("since 2.4"))
+RBIMPL_ATTR_DEPRECATED_SINCE(2.4)
static inline int
ruby_show_copyright_to_die(int exitcode)
{