diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-05 04:43:46 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-05 04:43:46 +0000 |
| commit | 42098e4e7fa0b57d0a5b1d1ebb5270bd585537b2 (patch) | |
| tree | 402c55ae7952263353e5cec27d9619d4b7132c9f /bcc32 | |
| parent | d8eb5a73af2550dec6d41ef74e1eda922f768117 (diff) | |
| download | ruby-42098e4e7fa0b57d0a5b1d1ebb5270bd585537b2.tar.gz ruby-42098e4e7fa0b57d0a5b1d1ebb5270bd585537b2.tar.xz ruby-42098e4e7fa0b57d0a5b1d1ebb5270bd585537b2.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@9502 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bcc32')
| -rw-r--r-- | bcc32/mkexports.rb | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/bcc32/mkexports.rb b/bcc32/mkexports.rb index e34b441e2..1b498f851 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 |
