summaryrefslogtreecommitdiff
path: root/win32/mkexports.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-28 03:15:31 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-28 03:15:31 +0000
commitb03817234803da053d0977fae2f84ef1f64ada27 (patch)
tree2d1d1e4a4cb859d7d439516c21f1936c688f5e2d /win32/mkexports.rb
parent02f9b4d60611016f06e3eae774c1ad9140780217 (diff)
* 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
Diffstat (limited to 'win32/mkexports.rb')
-rwxr-xr-xwin32/mkexports.rb17
1 files changed, 11 insertions, 6 deletions
diff --git a/win32/mkexports.rb b/win32/mkexports.rb
index 9b45051..d80ce03 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)