Skip to content

Commit 0c1c3ff

Browse files
nobumatzbot
authored andcommitted
[ruby/io-wait] Revert ruby/io-wait#9 "Make
the gem a noop on Rubies older than 2.6" This reverts commit ruby/io-wait@75fcb74c327f. The version that does nothing with pre-ruby 2.6 has already been released, so there is no longer need to consider older rubies in newer versions. ruby/io-wait@930d2f0d07
1 parent ddeefa2 commit 0c1c3ff

1 file changed

Lines changed: 15 additions & 19 deletions

File tree

ext/io/wait/extconf.rb

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
# frozen_string_literal: false
22
require 'mkmf'
33

4-
if RUBY_VERSION < "2.6"
5-
File.write("Makefile", dummy_makefile($srcdir).join(""))
4+
target = "io/wait"
5+
have_func("rb_io_wait", "ruby/io.h")
6+
have_func("rb_io_descriptor", "ruby/io.h")
7+
unless macro_defined?("DOSISH", "#include <ruby.h>")
8+
have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
9+
fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
10+
have_macro("FIONREAD", [h, ioctl_h].compact)
11+
end
12+
if fionread
13+
$defs << "-DFIONREAD_HEADER=\"<#{fionread}>\""
14+
create_makefile(target)
15+
end
616
else
7-
target = "io/wait"
8-
have_func("rb_io_wait", "ruby/io.h")
9-
have_func("rb_io_descriptor", "ruby/io.h")
10-
unless macro_defined?("DOSISH", "#include <ruby.h>")
11-
have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
12-
fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
13-
have_macro("FIONREAD", [h, ioctl_h].compact)
14-
end
15-
if fionread
16-
$defs << "-DFIONREAD_HEADER=\"<#{fionread}>\""
17-
create_makefile(target)
18-
end
19-
else
20-
if have_func("rb_w32_ioctlsocket", "ruby.h")
21-
have_func("rb_w32_is_socket", "ruby.h")
22-
create_makefile(target)
23-
end
17+
if have_func("rb_w32_ioctlsocket", "ruby.h")
18+
have_func("rb_w32_is_socket", "ruby.h")
19+
create_makefile(target)
2420
end
2521
end

0 commit comments

Comments
 (0)