diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 4475953..4f71d6e 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -125,6 +125,10 @@ io_get_write_io_fallback(VALUE io) #define rb_io_get_write_io io_get_write_io_fallback #endif +#ifndef DHAVE_RB_SYSERR_FAIL_STR +# define rb_syserr_fail_str(e, mesg) rb_exc_raise(rb_syserr_new_str(e, mesg)) +#endif + #define sys_fail(io) do { \ int err = errno; \ rb_syserr_fail_str(err, rb_io_path(io)); \ diff --git a/ext/io/console/extconf.rb b/ext/io/console/extconf.rb index 6161b74..30de410 100644 --- a/ext/io/console/extconf.rb +++ b/ext/io/console/extconf.rb @@ -5,6 +5,10 @@ # See https://bugs.ruby-lang.org/issues/20345 MakeMakefile::RbConfig ||= ::RbConfig +have_func("rb_syserr_fail_str(0, Qnil)") or +have_func("rb_syserr_new_str(0, Qnil)") or + abort + have_func("rb_io_path") have_func("rb_io_descriptor") have_func("rb_io_get_write_io")