Skip to content

Commit e1c7078

Browse files
committed
[GR-17457] Emit deprecation warnings for rb_iterate()
PullRequest: truffleruby/2813
2 parents e95ab59 + 252cee0 commit e1c7078

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

lib/cext/ABI_check.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5
1+
6

lib/cext/include/ruby/ruby.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2207,6 +2207,7 @@ int rb_keyword_given_p(void);
22072207
int rb_block_given_p(void);
22082208
void rb_need_block(void);
22092209
VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE);
2210+
DEPRECATED_BY(rb_block_call since 1.9, VALUE rb_iterate(VALUE(*)(VALUE),VALUE,rb_block_call_func_t,VALUE));
22102211
VALUE rb_block_call(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE);
22112212
VALUE rb_block_call_kw(VALUE,ID,int,const VALUE*,rb_block_call_func_t,VALUE,int);
22122213
VALUE rb_rescue(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE);

src/main/c/openssl/ossl_ssl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ static VALUE eSSLErrorWaitReadable;
3333
static VALUE eSSLErrorWaitWritable;
3434

3535
static ID id_call, ID_callback_state, id_tmp_dh_callback, id_tmp_ecdh_callback,
36-
id_npn_protocols_encoded;
36+
id_npn_protocols_encoded, id_each;
3737
static VALUE sym_exception, sym_wait_readable, sym_wait_writable;
3838

3939
static ID id_i_cert_store, id_i_ca_file, id_i_ca_path, id_i_verify_mode,
@@ -609,7 +609,7 @@ static VALUE
609609
ssl_encode_npn_protocols(VALUE protocols)
610610
{
611611
VALUE encoded = rb_str_new(NULL, 0);
612-
rb_iterate(rb_each, protocols, ssl_npn_encode_protocol_i, encoded);
612+
rb_block_call(protocols, id_each, 0, 0, ssl_npn_encode_protocol_i, encoded);
613613
return encoded;
614614
}
615615

@@ -2926,6 +2926,7 @@ Init_ossl_ssl(void)
29262926
id_tmp_dh_callback = rb_intern("tmp_dh_callback");
29272927
id_tmp_ecdh_callback = rb_intern("tmp_ecdh_callback");
29282928
id_npn_protocols_encoded = rb_intern("npn_protocols_encoded");
2929+
id_each = rb_intern("each");
29292930

29302931
#define DefIVarID(name) do \
29312932
id_i_##name = rb_intern("@"#name); while (0)

0 commit comments

Comments
 (0)