summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-08 17:27:56 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-08-09 11:21:56 +0900
commit733ffa74cd32a5c11ff744a5490782daa00ff1ae (patch)
tree744ef8f7c73e0fd0598588b87cb10cfc158ecbcc /include/ruby
parenta14671a6b6ad69bab443df75a3472575e2cc0dbc (diff)
Suppress deprecated rb_iterate declaration warnings in C++
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4720
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/backward/cxxanyargs.hpp4
-rw-r--r--include/ruby/internal/iterator.h8
2 files changed, 10 insertions, 2 deletions
diff --git a/include/ruby/backward/cxxanyargs.hpp b/include/ruby/backward/cxxanyargs.hpp
index 0af55977b2..b74992d10f 100644
--- a/include/ruby/backward/cxxanyargs.hpp
+++ b/include/ruby/backward/cxxanyargs.hpp
@@ -204,14 +204,14 @@ inline VALUE
rb_iterate(onearg_type *q, VALUE w, type *e, VALUE r)
{
rb_block_call_func_t t = reinterpret_cast<rb_block_call_func_t>(e);
- return ::rb_iterate(q, w, t, r);
+ return backward::rb_iterate(q, w, t, r);
}
#ifdef HAVE_NULLPTR
inline VALUE
rb_iterate(onearg_type *q, VALUE w, std::nullptr_t e, VALUE r)
{
- return ::rb_iterate(q, w, e, r);
+ return backward::rb_iterate(q, w, e, r);
}
#endif
diff --git a/include/ruby/internal/iterator.h b/include/ruby/internal/iterator.h
index a2aee15d31..e5d0d9b4b1 100644
--- a/include/ruby/internal/iterator.h
+++ b/include/ruby/internal/iterator.h
@@ -45,6 +45,14 @@ int rb_keyword_given_p(void);
int rb_block_given_p(void);
void rb_need_block(void);
VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE);
+#ifdef __cplusplus
+namespace ruby {namespace backward {
+static inline VALUE
+rb_iterate(VALUE (*iter)(VALUE), VALUE data1, rb_block_call_func_t bl, VALUE data2)
+{
+ return ::rb_iterate(iter, data1, bl, data2);
+}}}
+#endif
DEPRECATED_BY(rb_block_call since 1.9, VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE));
VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE);
VALUE rb_block_call_kw(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE,int);