Win: Strip CRs from cpp and nm output

The combination of mingw tools and cygin/msys2 ruby leaves CRs.
This commit is contained in:
Nobuyoshi Nakada 2025-07-31 16:45:09 +09:00 committed by Nobuyoshi Nakada
parent 6c24904a69
commit b3598cf2a3
2 changed files with 5 additions and 2 deletions

View file

@ -146,7 +146,9 @@ class Exports::Cygwin < Exports
end
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
def each_export(objs)
@ -155,7 +157,7 @@ class Exports::Cygwin < Exports
re = /\s(?:(T)|[[:upper:]])\s#{symprefix}((?!#{PrivateNames}).*)$/
objdump(objs) do |l|
next if /@.*@/ =~ l
yield $2, !$1 if re =~ l
yield $2.strip, !$1 if re =~ l
end
end
end