@@ -319,21 +319,14 @@ static VALUE io_spec_errno_set(VALUE self, VALUE val) {
319319
320320VALUE io_spec_mode_sync_flag (VALUE self , VALUE io ) {
321321 int mode ;
322- #ifdef RUBY_VERSION_IS_3_3
323322 mode = rb_io_mode (io );
324- #else
325- rb_io_t * fp ;
326- GetOpenFile (io , fp );
327- mode = fp -> mode ;
328- #endif
329323 if (mode & FMODE_SYNC ) {
330324 return Qtrue ;
331325 } else {
332326 return Qfalse ;
333327 }
334328}
335329
336- #if defined(RUBY_VERSION_IS_3_3 ) || defined(TRUFFLERUBY )
337330static VALUE io_spec_rb_io_mode (VALUE self , VALUE io ) {
338331 return INT2FIX (rb_io_mode (io ));
339332}
@@ -360,7 +353,6 @@ static VALUE io_spec_rb_io_open_descriptor(VALUE self, VALUE klass, VALUE descri
360353static VALUE io_spec_rb_io_open_descriptor_without_encoding (VALUE self , VALUE klass , VALUE descriptor , VALUE mode , VALUE path , VALUE timeout ) {
361354 return rb_io_open_descriptor (klass , FIX2INT (descriptor ), FIX2INT (mode ), path , timeout , NULL );
362355}
363- #endif
364356
365357void Init_io_spec (void ) {
366358 VALUE cls = rb_define_class ("CApiIOSpecs" , rb_cObject );
@@ -393,7 +385,6 @@ void Init_io_spec(void) {
393385 rb_define_method (cls , "rb_cloexec_open" , io_spec_rb_cloexec_open , 3 );
394386 rb_define_method (cls , "errno=" , io_spec_errno_set , 1 );
395387 rb_define_method (cls , "rb_io_mode_sync_flag" , io_spec_mode_sync_flag , 1 );
396- #if defined(RUBY_VERSION_IS_3_3 ) || defined(TRUFFLERUBY )
397388 rb_define_method (cls , "rb_io_mode" , io_spec_rb_io_mode , 1 );
398389 rb_define_method (cls , "rb_io_path" , io_spec_rb_io_path , 1 );
399390 rb_define_method (cls , "rb_io_closed_p" , io_spec_rb_io_closed_p , 1 );
@@ -404,7 +395,6 @@ void Init_io_spec(void) {
404395 rb_define_const (cls , "FMODE_BINMODE" , INT2FIX (FMODE_BINMODE ));
405396 rb_define_const (cls , "FMODE_TEXTMODE" , INT2FIX (FMODE_TEXTMODE ));
406397 rb_define_const (cls , "ECONV_UNIVERSAL_NEWLINE_DECORATOR" , INT2FIX (ECONV_UNIVERSAL_NEWLINE_DECORATOR ));
407- #endif
408398}
409399
410400#ifdef __cplusplus
0 commit comments