Bug #4214
closedFiddle::WINDOWS == false on Windows
Description
=begin
C:\Users\Jon>ruby --version
ruby 1.9.2p136 (2010-12-25 revision 30363) [i386-mingw32]
C:\Users\Jon>ruby -e "require 'fiddle';puts Fiddle::WINDOWS"
false
The root cause was that configure.in never checked for windows.h. Consequently, on Windows, .ext/include/i386-mingw32/ruby/config.h never defined the HAVE_WINDOWS_H macro used by fiddle in ext/fiddle/{fiddle.c,fiddle.h,function.c}. FYI, the HAVE_WINDOWS_H macro is also used by ext/dl/{cfunc.c,dl.h,handle.c} but I've not tested the DL code on Windows. Fiddle and DL appear to be the only places in the code that HAVE_WINDOWS_H is checked.
After the attached patch on trunk@30404 I get
C:\Users\Jon>ruby --version
ruby 1.9.3dev (2010-12-27 trunk 30404) [i386-mingw32]
C:\Users\Jon>ruby -e "require 'fiddle';puts Fiddle::WINDOWS"
true
The patch was tested on (a) Windows 7 Ultimate 32-bit using the RubyInstaller build recipes, (b) Arch Linux 2.6.36 32-bit, and (c) Arch Linux 32-bit cross-compiled for Windows. Running @make test-all TESTS=fiddle@ passes on both Win7 and Arch. The portion of the patch relating to win32/Makefile.sub is speculative as I don't build with VC. Perhaps Park H. or the mswin32 maintainer will verify.
Please backport an acceptable version of the patch to ruby_1_9_2 at your earliest convenience.
Jon
=end
Files