diff options
author | Joe George <joe@zeroc.com> | 2020-01-14 10:33:57 -0500 |
---|---|---|
committer | Joe George <joe@zeroc.com> | 2020-01-14 10:33:57 -0500 |
commit | 2ae3cb38d9b34f36e4d1b2fca4e484ef47201665 (patch) | |
tree | 4145befeecad00d60c3a417dd5bcd1aae5dc7fe9 /ruby/src/IceRuby/Util.cpp | |
parent | Bumped number of retries for Swift carthage update (diff) | |
download | ice-2ae3cb38d9b34f36e4d1b2fca4e484ef47201665.tar.bz2 ice-2ae3cb38d9b34f36e4d1b2fca4e484ef47201665.tar.xz ice-2ae3cb38d9b34f36e4d1b2fca4e484ef47201665.zip |
Fix Ruby 2.7 build failure (#677)
Replaced deprecated rb_iterate with rb_block_call
Diffstat (limited to 'ruby/src/IceRuby/Util.cpp')
-rw-r--r-- | ruby/src/IceRuby/Util.cpp | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/ruby/src/IceRuby/Util.cpp b/ruby/src/IceRuby/Util.cpp index 2c4a58233b4..b5b070602a4 100644 --- a/ruby/src/IceRuby/Util.cpp +++ b/ruby/src/IceRuby/Util.cpp @@ -448,7 +448,7 @@ IceRuby::contextToHash(const Ice::Context& ctx) extern "C" VALUE -IceRuby_Util_hash_foreach_callback(VALUE val, VALUE arg) +IceRuby_Util_hash_foreach_callback(VALUE val, VALUE arg, int, VALUE []) { VALUE key = rb_ary_entry(val, 0); VALUE value = rb_ary_entry(val, 1); @@ -465,17 +465,13 @@ IceRuby_Util_hash_foreach_callback(VALUE val, VALUE arg) return val; } -extern "C" -{ -typedef VALUE (*ICE_RUBY_HASH_FOREACH_CALLBACK)(...); -} - void IceRuby::hashIterate(VALUE h, HashIterator& iter) { assert(TYPE(h) == T_HASH); - callRuby(rb_iterate, rb_each, h, - reinterpret_cast<ICE_RUBY_HASH_FOREACH_CALLBACK>(IceRuby_Util_hash_foreach_callback), + + callRuby(::rb_block_call, h, rb_intern("each"), 0, static_cast<VALUE*>(0), + reinterpret_cast<rb_block_call_func_t>(IceRuby_Util_hash_foreach_callback), reinterpret_cast<VALUE>(&iter)); } |