2015-12-16 00:31:54 -05:00
|
|
|
# frozen_string_literal: false
|
2003-07-23 05:26:53 -04:00
|
|
|
require 'mkmf'
|
|
|
|
target = "io/wait"
|
|
|
|
|
2020-10-11 03:09:51 -04:00
|
|
|
have_func("rb_io_wait")
|
2003-08-05 23:11:14 -04:00
|
|
|
unless macro_defined?("DOSISH", "#include <ruby.h>")
|
2008-10-26 05:11:40 -04:00
|
|
|
have_header(ioctl_h = "sys/ioctl.h") or ioctl_h = nil
|
2008-06-24 04:05:06 -04:00
|
|
|
fionread = %w[sys/ioctl.h sys/filio.h sys/socket.h].find do |h|
|
2008-10-26 05:11:40 -04:00
|
|
|
have_macro("FIONREAD", [h, ioctl_h].compact)
|
2003-07-23 05:26:53 -04:00
|
|
|
end
|
2003-07-23 22:22:32 -04:00
|
|
|
if fionread
|
|
|
|
$defs << "-DFIONREAD_HEADER=\"<#{fionread}>\""
|
|
|
|
create_makefile(target)
|
|
|
|
end
|
2005-07-17 00:47:38 -04:00
|
|
|
else
|
|
|
|
if have_func("rb_w32_ioctlsocket", "ruby.h")
|
|
|
|
have_func("rb_w32_is_socket", "ruby.h")
|
|
|
|
create_makefile(target)
|
|
|
|
end
|
2003-07-23 05:26:53 -04:00
|
|
|
end
|