Ruby: include/ruby/backward.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

backward.h
Go to the documentation of this file.
1#ifndef RUBY_RUBY_BACKWARD_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RUBY_RUBY_BACKWARD_H 1
11#include "ruby/internal/value.h"
12#include "ruby/internal/interpreter.h"
13#include "ruby/backward/2/attributes.h"
14
15#define DECLARE_DEPRECATED_FEATURE(ver, func) \
16 NORETURN(ERRORFUNC(("deprecated since "#ver), DEPRECATED(void func(void))))
17
18/* eval.c */
19 DECLARE_DEPRECATED_FEATURE(2.2, rb_disable_super);
20 DECLARE_DEPRECATED_FEATURE(2.2, rb_enable_super);
21
22/* hash.c */
23 DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_iter_lev);
24 DECLARE_DEPRECATED_FEATURE(2.2, rb_hash_ifnone);
25
26/* string.c */
27 DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associate);
28 DECLARE_DEPRECATED_FEATURE(2.2, rb_str_associated);
29
30/* variable.c */
31 DEPRECATED(void rb_autoload(VALUE, ID, const char*));
32
33/* vm.c */
34 DECLARE_DEPRECATED_FEATURE(2.2, rb_clear_cache);
35 DECLARE_DEPRECATED_FEATURE(2.2, rb_frame_pop);
36
37#define DECLARE_DEPRECATED_INTERNAL_FEATURE(func) \
38 NORETURN(ERRORFUNC(("deprecated internal function"), DEPRECATED(void func(void))))
39
40/* eval.c */
41 NORETURN(ERRORFUNC(("internal function"), void rb_frozen_class_p(VALUE)));
42 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_exec_end_proc);
43
44/* error.c */
45 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error);
46 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error_with_enc);
47 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_compile_error_append);
48
49/* gc.c */
50 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_gc_call_finalizer_at_exit);
51
52/* signal.c */
53 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_trap_exit);
54
55/* struct.c */
56 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_struct_ptr);
57
58/* thread.c */
59 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_clear_trace_func);
60
61/* variable.c */
62 DECLARE_DEPRECATED_INTERNAL_FEATURE(rb_generic_ivar_table);
63 NORETURN(ERRORFUNC(("internal function"), VALUE rb_mod_const_missing(VALUE, VALUE)));
64
65/* from version.c */
66#if defined(RUBY_SHOW_COPYRIGHT_TO_DIE) && !!(RUBY_SHOW_COPYRIGHT_TO_DIE+0)
67/* for source code backward compatibility */
68 RBIMPL_ATTR_DEPRECATED(("since 2.4"))
69static inline int
70ruby_show_copyright_to_die(int exitcode)
71{
72 ruby_show_copyright();
73 return exitcode;
74}
75#define ruby_show_copyright() /* defer EXIT_SUCCESS */ \
76 (exit(ruby_show_copyright_to_die(EXIT_SUCCESS)))
77#endif
78
79#endif /* RUBY_RUBY_BACKWARD_H */
attributes.h
Various attribute-related macros.
NORETURN
#define NORETURN(x)
Definition: attributes.h:152
ERRORFUNC
#define ERRORFUNC(mesg, x)
Definition: attributes.h:90
DEPRECATED
#define DEPRECATED(x)
Definition: attributes.h:57
rb_mod_const_missing
VALUE rb_mod_const_missing(VALUE, VALUE)
Definition: variable.c:1960
DECLARE_DEPRECATED_INTERNAL_FEATURE
#define DECLARE_DEPRECATED_INTERNAL_FEATURE(func)
Definition: backward.h:37
DECLARE_DEPRECATED_FEATURE
#define DECLARE_DEPRECATED_FEATURE(ver, func)
Definition: backward.h:15
rb_frozen_class_p
void rb_frozen_class_p(VALUE)
rb_autoload
void rb_autoload(VALUE, ID, const char *)
Definition: variable.c:2149
RBIMPL_ATTR_DEPRECATED
#define RBIMPL_ATTR_DEPRECATED(msg)
Wraps (or simulates) [[deprecated]]
Definition: deprecated.h:60
ruby_show_copyright
void ruby_show_copyright(void)
Prints the copyright notice of the CRuby interpreter to stdout.
Definition: version.c:138
interpreter.h
Interpreter embedding APIs.
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38
ID
unsigned long ID
Definition: value.h:39