Project

General

Profile

Actions

Bug #4214

closed

Fiddle::WINDOWS == false on Windows

Added by jonforums (Jon Forums) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 1.9.2p136 (2010-12-25 revision 30363) [i386-mingw32]
Backport:
[ruby-core:33923]

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

0001-fix-fiddle-windows-constant.patch (1.48 KB) 0001-fix-fiddle-windows-constant.patch jonforums (Jon Forums), 12/28/2010 12:46 AM
predefs.c (304 Bytes) predefs.c jonforums (Jon Forums), 12/28/2010 11:31 PM
0001-windows-macros-for-dl-n-fiddle.patch (3.53 KB) 0001-windows-macros-for-dl-n-fiddle.patch jonforums (Jon Forums), 12/29/2010 06:39 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0