From b03817234803da053d0977fae2f84ef1f64ada27 Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 28 Nov 2011 03:15:31 +0000 Subject: [PATCH] * win32/mkexports.rb (Exports#read_substitution): need to read from subst.h too. [Bug #5675] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ win32/mkexports.rb | 17 +++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 098bb242bc..3674f137f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Nov 28 12:15:28 2011 Nobuyoshi Nakada + + * win32/mkexports.rb (Exports#read_substitution): need to read + from subst.h too. [Bug #5675] + Mon Nov 28 11:46:35 2011 NAKAMURA Usaku * io.c (rb_io_flush): release GVL during fsync() on Windows. diff --git a/win32/mkexports.rb b/win32/mkexports.rb index 9b450519ce..d80ce033cd 100755 --- a/win32/mkexports.rb +++ b/win32/mkexports.rb @@ -41,8 +41,17 @@ class Exports syms[internal] = export winapis[$1] = internal if /^_?(rb_w32_\w+)(?:@\d+)?$/ =~ internal end - win32h = File.join(File.dirname(File.dirname(__FILE__)), "include/ruby/win32.h") - IO.foreach(win32h) do |line| + incdir = File.join(File.dirname(File.dirname(__FILE__)), "include/ruby") + read_substitution(incdir+"/win32.h", syms, winapis) + read_substitution(incdir+"/subst.h", syms, winapis) + syms["NtInitialize"] ||= "ruby_sysinit" if syms["ruby_sysinit"] + syms["rb_w32_vsnprintf"] ||= "ruby_vsnprintf" + syms["rb_w32_snprintf"] ||= "ruby_snprintf" + @syms = syms + end + + def read_substitution(header, syms, winapis) + IO.foreach(header) do |line| if /^#define (\w+)\((.*?)\)\s+(?:\(void\))?(rb_w32_\w+)\((.*?)\)\s*$/ =~ line and $2.delete(" ") == $4.delete(" ") export, internal = $1, $3 @@ -51,10 +60,6 @@ class Exports end end end - syms["NtInitialize"] ||= "ruby_sysinit" if syms["ruby_sysinit"] - syms["rb_w32_vsnprintf"] ||= "ruby_vsnprintf" - syms["rb_w32_snprintf"] ||= "ruby_snprintf" - @syms = syms end def exports(name = $name, library = $library, description = $description)