2002-06-10 21:27:48 -04:00
|
|
|
#!./miniruby -s
|
|
|
|
|
2005-11-04 23:43:46 -05:00
|
|
|
$:.unshift(File.expand_path("../..", __FILE__))
|
|
|
|
require 'win32/mkexports'
|
2002-06-10 21:27:48 -04:00
|
|
|
|
2005-11-04 23:43:46 -05:00
|
|
|
class Exports::Bcc < Exports
|
|
|
|
Forwards = /^rb_w32_(\w+)/
|
2002-06-10 21:27:48 -04:00
|
|
|
|
2005-11-04 23:43:46 -05:00
|
|
|
def forwarding(internal, export)
|
|
|
|
internal[/\A_?/]+export
|
|
|
|
end
|
|
|
|
|
|
|
|
def each_export(objs)
|
|
|
|
objs.each do |obj|
|
|
|
|
opt = /\.(?:so|dll)\z/i =~ obj ? "-ee" : "-oiPUBDEF -oiPUBD32"
|
|
|
|
IO.foreach("|tdump -q #{opt} #{obj.tr('/', '\\')} < nul") do |l|
|
|
|
|
next unless /(?:PUBDEF|PUBD32|EXPORT)/ =~ l
|
2007-10-12 20:02:20 -04:00
|
|
|
yield $1, !$2 /'(.*?)'\s+Segment:\s+_(TEXT)?/ =~ l
|
2005-11-04 23:43:46 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
yield "_strcasecmp", "_stricmp"
|
|
|
|
yield "_strncasecmp", "_strnicmp"
|
|
|
|
end
|
2002-06-10 21:27:48 -04:00
|
|
|
end
|