summaryrefslogtreecommitdiff
path: root/win32/mkexports.rb
diff options
context:
space:
mode:
Diffstat (limited to 'win32/mkexports.rb')
-rwxr-xr-xwin32/mkexports.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/win32/mkexports.rb b/win32/mkexports.rb
index 214e4c6..6ebe443 100755
--- a/win32/mkexports.rb
+++ b/win32/mkexports.rb
@@ -7,13 +7,14 @@ SYM = {}
objs = ARGV.collect {|s| s.tr('/', '\\')}
IO.foreach("|dumpbin -symbols " + objs.join(' ')) do |l|
next if /^[0-9A-F]+ 0+ UNDEF / =~ l
- next unless l.sub!(/.*\sExternal\s+\|\s+/, '')
+ next unless l.sub!(/.*?\s(\(\)\s+)?External\s+\|\s+/, "")
+ is_data = !$1
if l.sub!(/^_/, '')
next if /@.*@/ =~ l || /@[0-9a-f]{16}$/ =~ l
elsif !l.sub!(/^(\S+) \([^@?\`\']*\)$/, '\1')
next
end
- SYM[l.strip] = true
+ SYM[l.strip] = is_data
end
exports = []
@@ -23,7 +24,10 @@ elsif $library
exports << "Library " + $library
end
exports << "Description " + $description.dump if $description
-exports << "EXPORTS" << SYM.keys.sort
+exports << "EXPORTS"
+SYM.sort.each do |sym, is_data|
+ exports << (is_data ? "#{sym} DATA" : sym)
+end
if $output
open($output, 'w') {|f| f.puts exports.join("\n")}