summaryrefslogtreecommitdiff
path: root/bcc32
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-05 04:43:46 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-11-05 04:43:46 +0000
commit49775b88e9cc4381f6e43e4465c7003bdba2b228 (patch)
tree402c55ae7952263353e5cec27d9619d4b7132c9f /bcc32
parent479b27ac41a3d1d6d8fc04854a60df19d0389f45 (diff)
* configure.in, cygwin/GNUmakefile.in (mingw): use def file to alias
symbols. [ruby-dev:27532] * bcc32/mkexports.rb, win32/mkexports.rb: make aliases in DLL. * win32/win32.c, win32/win32.h: replace symbols only when RUBY_EXPORT is defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bcc32')
-rw-r--r--bcc32/mkexports.rb39
1 files changed, 19 insertions, 20 deletions
diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb
index e34b441e2f..1b498f8515 100644
--- a/bcc32/mkexports.rb
+++ b/bcc32/mkexports.rb
@@ -1,25 +1,24 @@
#!./miniruby -s
-SYM = {}
-STDIN.reopen(open("nul"))
-ARGV.each do |obj|
- IO.foreach("|tdump -q -oiPUBDEF -oiPUBD32 #{obj.tr('/', '\\')}") do |l|
- next unless /(?:PUBDEF|PUBD32)/ =~ l
- SYM[$1] = true if /'(.*?)'/ =~ l
- end
-end
+$:.unshift(File.expand_path("../..", __FILE__))
+require 'win32/mkexports'
-exports = []
-if $name
- exports << "Name " + $name
-elsif $library
- exports << "Library " + $library
-end
-exports << "Description " + $description.dump if $description
-exports << "EXPORTS" << SYM.keys.sort
+class Exports::Bcc < Exports
+ Forwards = /^rb_w32_(\w+)/
-if $output
- open($output, 'w') {|f| f.puts exports.join("\n")}
-else
- puts exports.join("\n")
+ 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
+ yield $1 if /'(.*?)'/ =~ l
+ end
+ end
+ yield "_strcasecmp", "_stricmp"
+ yield "_strncasecmp", "_strnicmp"
+ end
end