* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git] / bcc32 / mkexports.rb
blob888ab2e2a631b0d189c7a1963711a328a12e7364
1 #!./miniruby -s
3 $:.unshift(File.expand_path("../..", __FILE__))
4 require 'win32/mkexports'
6 class Exports::Bcc < Exports
7   def forwarding(internal, export)
8     internal[/\A_?/]+export
9   end
11   def each_line(objs, &block)
12     objs.each do |obj|
13       opt = /\.(?:so|dll)\z/i =~ obj ? "-ee" : "-oiPUBDEF -oiPUBD32"
14       IO.foreach("|tdump -q #{opt} #{obj.tr('/', '\\')} < nul", &block)
15     end
16   end
18   def each_export(objs)
19     objdump(objs) do |l|
20       next unless /(?:PUBDEF|PUBD32|EXPORT)/ =~ l
21       yield $1 if /'(.*?)'/ =~ l
22     end
23     yield "_strcasecmp", "_stricmp"
24     yield "_strncasecmp", "_strnicmp"
25   end
26 end