[libcxx][RFC] Make (w)cin/(w)cout/(w)cerr works under Windows

Yi-Hong Lyu via cfe-commits cfe-commits at lists.llvm.org
Wed May 11 13:13:36 PDT 2016


Hello all,

According to that Windows mangler takes data type into account. Reference
of std::cin would be translated into ?cin at __1@std@@3V?$basic_istream at DU
?$char_traits at D@__1 at std@@@12 at A (class std::__1::basic_istream<char,struct
std::__1::char_traits<char> > std::__1::cin). Definition of std::cin, in
contrast, would be translated into ?cin at __1@std@@3PADA (char *
std::__1::cin). There is a linking error because two symbols are different.
In the other hand, Itanium mangler doesn't take data type into account.
Either reference or definition of std::cin would be translated into
__ZNSt3__13cinE. To make (w)cin/(w)cout/(w)cerr works under Windows, I
rewrite part of the code under src/iostream.cpp and the patch is attached.
I am wondering whether it would be a appropriate fix for the issue.

Any comment or suggestion is welcomed,
Yi-Hong
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160512/26654db9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cin_cout_cerr.patch
Type: application/octet-stream
Size: 3696 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160512/26654db9/attachment.obj>


More information about the cfe-commits mailing list