Skip to content

Commit be88227

Browse files
rheniumnobu
authored andcommitted
Move RBIMPL_ATTR_DEPRECATED_* macros to the appropriate header file
Move these macros from include/ruby/backward.h to include/ruby/internal/attr/deprecated.h, alongside the other similar macros. include/ruby/internal/intern/vm.h cannot currently use them because include/ruby/backward.h is included too late.
1 parent f2eece7 commit be88227

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

include/ruby/backward.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
#include "ruby/internal/interpreter.h"
1212
#include "ruby/backward/2/attributes.h"
1313

14-
#define RBIMPL_ATTR_DEPRECATED_SINCE(ver) RBIMPL_ATTR_DEPRECATED(("since " #ver))
15-
#define RBIMPL_ATTR_DEPRECATED_INTERNAL(ver) RBIMPL_ATTR_DEPRECATED(("since "#ver", also internal"))
16-
#define RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY() RBIMPL_ATTR_DEPRECATED(("only for internal use"))
17-
1814
RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY() void rb_clear_constant_cache(void);
1915

2016
/* from version.c */

include/ruby/internal/attr/deprecated.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,11 @@
7272
# define RBIMPL_ATTR_DEPRECATED_EXT(msg) RBIMPL_ATTR_DEPRECATED(msg)
7373
#endif
7474

75+
#define RBIMPL_ATTR_DEPRECATED_SINCE(ver) \
76+
RBIMPL_ATTR_DEPRECATED(("since " #ver))
77+
#define RBIMPL_ATTR_DEPRECATED_INTERNAL(ver) \
78+
RBIMPL_ATTR_DEPRECATED(("since "#ver", also internal"))
79+
#define RBIMPL_ATTR_DEPRECATED_INTERNAL_ONLY() \
80+
RBIMPL_ATTR_DEPRECATED(("only for internal use"))
81+
7582
#endif /* RBIMPL_ATTR_DEPRECATED_H */

include/ruby/internal/intern/vm.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ VALUE rb_check_funcall(VALUE recv, ID mid, int argc, const VALUE *argv);
9595
*/
9696
VALUE rb_check_funcall_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int kw_splat);
9797

98-
#ifdef RBIMPL_ATTR_DEPRECATED_INTERNAL
9998
/**
10099
* This API is practically a variant of rb_proc_call_kw() now. Historically
101100
* when there still was a concept called `$SAFE`, this was an API for that.
@@ -112,7 +111,6 @@ VALUE rb_check_funcall_kw(VALUE recv, ID mid, int argc, const VALUE *argv, int k
112111
*/
113112
RBIMPL_ATTR_DEPRECATED_INTERNAL(4.0)
114113
VALUE rb_eval_cmd_kw(VALUE cmd, VALUE arg, int kw_splat);
115-
#endif
116114

117115
/**
118116
* Identical to rb_funcallv(), except it takes Ruby's array instead of C's.

0 commit comments

Comments
 (0)