mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Win: Strip CRs from cpp
and nm
output
The combination of mingw tools and cygin/msys2 ruby leaves CRs.
This commit is contained in:
parent
6c24904a69
commit
b3598cf2a3
2 changed files with 5 additions and 2 deletions
|
@ -9,6 +9,7 @@ while /\A(\w+)=(.*)/ =~ ARGV[0]
|
||||||
end
|
end
|
||||||
if inc = arg['i']
|
if inc = arg['i']
|
||||||
src = inc == '-' ? STDIN.read : File.read(inc)
|
src = inc == '-' ? STDIN.read : File.read(inc)
|
||||||
|
src.tr!("\r", " ")
|
||||||
src.gsub!(/^#.*\n/, '')
|
src.gsub!(/^#.*\n/, '')
|
||||||
else
|
else
|
||||||
src = ""
|
src = ""
|
||||||
|
|
|
@ -146,7 +146,9 @@ class Exports::Cygwin < Exports
|
||||||
end
|
end
|
||||||
|
|
||||||
def each_line(objs, &block)
|
def each_line(objs, &block)
|
||||||
IO.foreach("|#{self.class.nm} --extern-only --defined-only #{objs.join(' ')}", &block)
|
IO.popen(%W[#{self.class.nm} --extern-only --defined-only] + objs) do |f|
|
||||||
|
f.each(&block)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def each_export(objs)
|
def each_export(objs)
|
||||||
|
@ -155,7 +157,7 @@ class Exports::Cygwin < Exports
|
||||||
re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!#{PrivateNames}).*)$/
|
re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!#{PrivateNames}).*)$/
|
||||||
objdump(objs) do |l|
|
objdump(objs) do |l|
|
||||||
next if /@.*@/ =~ l
|
next if /@.*@/ =~ l
|
||||||
yield $2, !$1 if re =~ l
|
yield $2.strip, !$1 if re =~ l
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue