<div dir="ltr">The UTF8ToUTF16 stuff was actually solved a different way.  Seems we had manually written UTF conversion functions that didn't invoke the windows APIs at all in include/llvm/Support/ConvertUTF.h.  It needed one more overload for the 16->8 direction which rnk@ added.  So now we're not hitting the Windows API at all for UTF conversion anymore.  At least not from the PDB library.  Other Windows code still is, but the idea is for those to be converted over to the ConvertUTF.h functions and then eventually delete the Windows API ones.<br><div><br></div><div>There's quite a lot of functionality that could go into a public windows header file.  registry access and com initialization are two definite candidates that come to mind.  I guess this will happen eventually, just a matter of when.  Maybe in my off time one of these days :)</div></div><br><div class="gmail_quote">On Wed Feb 11 2015 at 1:23:32 PM Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wed, Feb 11, 2015 at 4:21 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>> wrote:<br>
> WindowsSupport.h is in the src tree unfortunately.  It's usually included<br>
> for files in lib\Support\Windows because they can use #include<br>
> "WindowsSupport.h", but in this case the project does not live in a<br>
> different tree, so isn't possible to include that.  Although I'm definitely<br>
> happy if we can move towards WindowsSupport headers being public.<br>
<br>
Ugh. The good news is, making that header a public one will expose<br>
UTF8ToUTF16 and friends, which we also happen to need.<br>
<br>
Since this code is in a .cpp file and not a .h file, I think it's fine<br>
as-is for now.<br>
<br>
~Aaron<br>
<br>
><br>
> On Wed Feb 11 2015 at 1:00:22 PM Aaron Ballman <<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>><br>
> wrote:<br>
>><br>
>> A possible nit below<br>
>><br>
>> On Tue, Feb 10, 2015 at 5:47 PM, Zachary Turner <<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>><br>
>> wrote:<br>
>> > Author: zturner<br>
>> > Date: Tue Feb 10 16:47:14 2015<br>
>> > New Revision: 228756<br>
>> ><br>
>> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=228756&view=rev" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project?rev=228756&view=rev</a><br>
>> > Log:<br>
>> > Oops.  Don't call Windows functions on non-windows.<br>
>> ><br>
>> > Modified:<br>
>> >     llvm/trunk/tools/llvm-pdbdump/<u></u>llvm-pdbdump.cpp<br>
>> ><br>
>> > Modified: llvm/trunk/tools/llvm-pdbdump/<u></u>llvm-pdbdump.cpp<br>
>> > URL:<br>
>> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbdump/llvm-pdbdump.cpp?rev=228756&r1=228755&r2=228756&view=diff" target="_blank">http://llvm.org/viewvc/llvm-<u></u>project/llvm/trunk/tools/llvm-<u></u>pdbdump/llvm-pdbdump.cpp?rev=<u></u>228756&r1=228755&r2=228756&<u></u>view=diff</a><br>
>> ><br>
>> > ==============================<u></u>==============================<u></u>==================<br>
>> > --- llvm/trunk/tools/llvm-pdbdump/<u></u>llvm-pdbdump.cpp (original)<br>
>> > +++ llvm/trunk/tools/llvm-pdbdump/<u></u>llvm-pdbdump.cpp Tue Feb 10 16:47:14<br>
>> > 2015<br>
>> > @@ -15,6 +15,7 @@<br>
>> ><br>
>> >  #include "llvm/ADT/ArrayRef.h"<br>
>> >  #include "llvm/ADT/StringExtras.h"<br>
>> > +#include "llvm/Config/config.h"<br>
>> >  #include "llvm/DebugInfo/PDB/PDB.h"<br>
>> >  #include "llvm/DebugInfo/PDB/<u></u>IPDBEnumChildren.h"<br>
>> >  #include "llvm/DebugInfo/PDB/<u></u>IPDBSession.h"<br>
>> > @@ -30,7 +31,9 @@<br>
>> >  #include "llvm/Support/<u></u>PrettyStackTrace.h"<br>
>> >  #include "llvm/Support/Signals.h"<br>
>> ><br>
>> > +#if defined(HAVE_DIA_SDK)<br>
>> >  #include <Windows.h><br>
>> > +#endif<br>
>><br>
>> Please do not include Windows.h directly, but instead use WindowsSupport.h<br>
>><br>
>> ~Aaron<br>
</blockquote></div>