Skip to content

Commit 09aa024

Browse files
committed
Fix deprecation warnung about fptr->tied_io_for_writing
``` ../../../../ext/fox16_c/FXRuby.cpp: In function ‘FX::FXInputHandle FXRbGetWriteFileHandle(VALUE, FX::FXuint)’: ../../../../ext/fox16_c/FXRuby.cpp:1661:22: warning: ‘rb_io::tied_io_for_writing’ is deprecated: rb_io_get_write_io [-Wdeprecated-declarations] 1661 | VALUE wrio = fptr->tied_io_for_writing; | ^~~~~~~~~~~~~~~~~~~ In file included from ../../../../ext/fox16_c/FXRuby.cpp:46: /home/lars/.rvm/rubies/ruby-4.0.0/include/ruby-4.0.0/ruby/io.h:345:11: note: declared here 345 | VALUE tied_io_for_writing; | ^~~~~~~~~~~~~~~~~~~ ```
1 parent 710a76c commit 09aa024

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎ext/fox16_c/FXRuby.cpp‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,11 +1652,8 @@ FXInputHandle FXRbGetWriteFileHandle(VALUE obj,FXuint mode) {
16521652
if(rb_ivar_defined(obj, vwrite)) obj = rb_ivar_get(obj, vwrite);
16531653
fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
16541654
#else
1655-
rb_io_t *fptr;
1656-
GetOpenFile(obj, fptr);
1657-
VALUE wrio = fptr->tied_io_for_writing;
1658-
if(wrio) obj = wrio;
1659-
fd = FIX2INT(rb_funcall(obj, rb_intern("fileno"), 0));
1655+
VALUE wrio = rb_io_get_write_io(obj);
1656+
fd = FIX2INT(rb_funcall(wrio, rb_intern("fileno"), 0));
16601657
#endif
16611658
#ifdef WIN32
16621659
#ifdef __CYGWIN__

0 commit comments

Comments
 (0)