The function<span class="Apple-style-span" style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "> available in clang/lib/Basic/ConvertUTF.c deals with unsigned shorts, and I need wchar_t?</span><br>

<br><div class="gmail_quote">On Thu, Sep 1, 2011 at 9:36 AM, Jean-Daniel Dupas <span dir="ltr"><<a href="mailto:devlists@shadowlab.org">devlists@shadowlab.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>
Le 31 août 2011 Ã  21:02, Aaron Ballman a Ã©crit :<br>
<div class="im"><br>
> On Wed, Aug 31, 2011 at 1:17 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>> wrote:<br>
>> On Wed, Aug 31, 2011 at 10:58 AM, Nikola Smiljanic <<a href="mailto:popizdeh@gmail.com">popizdeh@gmail.com</a>> wrote:<br>
>>> _wopen expects wchar_t* and the only visible function for conversion to<br>
>>> utf16 is ConvertUTF8toUTF32 which converts to unsigned shorts.<br>
>><br>
>> If you're in #ifdef WIN32 code, just use ConvertUTF8toUTF16 and<br>
>> reinterpret_cast from unsigned short* to wchar_t*.<br>
><br>
> I think the problem is that PathV2.inc is part of LLVM, and the<br>
> ConvertUTF8ToUTF16 function is in an anonymous namespace. Â So the<br>
> question becomes: raise the function into an accessible namespace,<br>
> duplicate code, or find some other mechanism?<br>
<br>
</div>This function is also available in clang/lib/Basic/ConvertUTF.c<br>
<div class="im"><br>
><br>
> I don't think it makes sense to raise the function out of the<br>
> anonymous namespace unless it's also moved (it has nothing to do with<br>
> paths per se). Â Perhaps it's worth it to move it to StringRef?<br>
><br>
> ~Aaron<br>
><br>
</div><div class="im">> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
</div><font color="#888888">-- Jean-Daniel<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br>