From bcf61f58d518308658de1c208703bfdd7f79d1c7 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 26 Oct 2008 09:11:40 +0000 Subject: [PATCH] * ext/io/wait/{extconf.rb,wait.c}: needs sys/ioctl.h for fcntl on cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19947 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 ++++- ext/io/wait/extconf.rb | 3 ++- ext/io/wait/wait.c | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 486f3faae2..eb2cfce3b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Sun Oct 26 18:07:20 2008 Nobuyoshi Nakada +Sun Oct 26 18:11:23 2008 Nobuyoshi Nakada * thread.c (blocking_region_{begin,end}): declared as inline. @@ -8,6 +8,9 @@ Sun Oct 26 18:07:20 2008 Nobuyoshi Nakada * ext/etc/etc.c (sGroup): getgrent may not be available. + * ext/io/wait/{extconf.rb,wait.c}: needs sys/ioctl.h for fcntl on + cygwin. + Sun Oct 26 13:30:28 2008 Nobuyoshi Nakada * io.c (read_all): use the given buffer to read when needs readconv. diff --git a/ext/io/wait/extconf.rb b/ext/io/wait/extconf.rb index 1a0edbd846..eed3543124 100644 --- a/ext/io/wait/extconf.rb +++ b/ext/io/wait/extconf.rb @@ -2,8 +2,9 @@ require 'mkmf' target = "io/wait" unless macro_defined?("DOSISH", "#include ") + 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) + have_macro("FIONREAD", [h, ioctl_h].compact) end if fionread $defs << "-DFIONREAD_HEADER=\"<#{fionread}>\"" diff --git a/ext/io/wait/wait.c b/ext/io/wait/wait.c index c073f1de30..42f5e8fc48 100644 --- a/ext/io/wait/wait.c +++ b/ext/io/wait/wait.c @@ -14,6 +14,9 @@ #include "ruby/io.h" #include +#if defined(HAVE_SYS_IOCTL_H) +#include +#endif #if defined(FIONREAD_HEADER) #include FIONREAD_HEADER #endif