diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-08 17:27:56 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2021-08-09 11:21:56 +0900 |
commit | 733ffa74cd32a5c11ff744a5490782daa00ff1ae (patch) | |
tree | 744ef8f7c73e0fd0598588b87cb10cfc158ecbcc /include/ruby/internal/iterator.h | |
parent | a14671a6b6ad69bab443df75a3472575e2cc0dbc (diff) |
Suppress deprecated rb_iterate declaration warnings in C++
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4720
Diffstat (limited to 'include/ruby/internal/iterator.h')
-rw-r--r-- | include/ruby/internal/iterator.h | 8 |
1 files changed, 8 insertions, 0 deletions
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); |