<div dir="ltr">Something like this:<div>// windows.h</div><div>#define     IMAGE_FILE_MACHINE_AMD64     0x8664</div><div>// COFF.h</div><div><div>  enum MachineTypes {</div></div><div><div>    IMAGE_FILE_MACHINE_AMD64     = 0x8664,</div>
</div><div>  };</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jun 6, 2014 at 11:09 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Couldn't this be solved by definining everything we need (e.g. _WIN32_WINNT, NOMINMAX, etc) at the CMake level?  What's the problem with COFF.h?</div>
<div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">
On Fri, Jun 6, 2014 at 11:07 AM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 6, 2014 at 10:52 AM, Zachary Turner <span dir="ltr"><<a href="mailto:zturner@google.com" target="_blank">zturner@google.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Ack, this breaks everything.  WindowsSupport.h is in src\llvm\lib\Support\Windows.  In other words, it's not in the include path.  It's usually only included from source files, in which case it's in the same tree, so it works.  It this kind of "don't put platform specific stuff in header files" a universal policy?  It seems to me like the WindowsSupport.h (and correspondingly, the Unix support headers), should be in the include directories so other headers can use them.  I'm guessing a lot of the reason that these void* impls are needed is precisely because of this restriction, and could be done away with in many cases if header files had access to platform specific types, even if only through other header files which typedefed platformed specific types to a set of common, platform-independent types.</div>



</div></div></div>
</blockquote></div><br></div></div><div class="gmail_extra">LLVM has a bunch of conflicts with windows.h, so including it from include/* will break if someone includes it with llvm/Support/COFF.h.  windows.h has so many configuration macros (WIN32_LEAN_AND_MEAN, WINVER, NOMINMAX) that including it broadly is inviting include order dependence problems, so we've avoided it so far.</div>


<div class="gmail_extra"><br></div><div class="gmail_extra">I think we should be able to get by with a semi-opaque CriticalSectionMutex, where the methods are defined out-of-line in lib/Support/Windows/Something.inc.</div>


</div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>