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