ruby/ext/io/wait/extconf.rb
Nobuyoshi Nakada 0c1c3ffa22 [ruby/io-wait] Revert https://github.com/ruby/io-wait/pull/9 "Make
the gem a noop on Rubies older than
2.6"

This reverts commit 75fcb74c32.

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.

930d2f0d07
2025-07-09 10:34:56 +00:00

21 lines
609 B
Ruby

# frozen_string_literal: false
require 'mkmf'
target = "io/wait"
have_func("rb_io_wait", "ruby/io.h")
have_func("rb_io_descriptor", "ruby/io.h")
unless macro_defined?("DOSISH", "#include <ruby.h>")
have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
have_macro("FIONREAD", [h, ioctl_h].compact)
end
if fionread
$defs << "-DFIONREAD_HEADER=\"<#{fionread}>\""
create_makefile(target)
end
else
if have_func("rb_w32_ioctlsocket", "ruby.h")
have_func("rb_w32_is_socket", "ruby.h")
create_makefile(target)
end
end