<div dir="ltr">It was happening in a few files using COFF.h in LLDB for the windows branch (Windows.h is required for some typedef over Mutex, thread, socket, etc...).<div><br></div><div>As said before, I am currently checking if it could be avoided (probably some refactoring will be needed). However I was wondering if it might not be easier to just avoid this clash at all by avoiding it in LLVM.</div>


<div><br></div><div>Alternatively I could #undef everything right after including Windows.h.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 29, 2013 at 11:08 AM, Nick Kledzik <span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div><div>On Aug 28, 2013, at 7:05 PM, Virgile Bello <<a href="mailto:virgile.bello@gmail.com" target="_blank">virgile.bello@gmail.com</a>> wrote:</div>


<blockquote type="cite"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">


<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px">Right now, we have:</div><div style="font-family:arial,sans-serif;font-size:13px">In COFF.h:</div><div style="font-family:arial,sans-serif;font-size:13px">


    class COFF { enum MachineTypes { IMAGE_FILE_MACHINE_UNKNOWN   = 0x0, ... }; };</div><div style="font-family:arial,sans-serif;font-size:13px">In windows.h:</div><div style="font-family:arial,sans-serif;font-size:13px">


    #define IMAGE_FILE_MACHINE_UNKNOWN 0<br></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">* If you first include COFF.h and then windows.h,</div>


<div style="font-family:arial,sans-serif;font-size:13px">    COFF::IMAGE_FILE_MACHINE_UNKNOWN</div><div style="font-family:arial,sans-serif;font-size:13px">will be preprocessed into<br></div><div style="font-family:arial,sans-serif;font-size:13px">


    COFF:0.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">* If you first include Windows.h and then COFF.h, COFF.h won't work because it's enum will become:</div>


<div style="font-family:arial,sans-serif;font-size:13px">    enum MachinTypes { 0 = 0x0 };</div></div></div></blockquote></div><div>Sorry, I was not clear.  Why is Windows.h being included at all?  That header does not exist on some OS’s so the code would not build be portable.  If this use is in the one or two files of llvm that implement platform support, why is COFF.h being included in those instances?</div>


<span><font color="#888888"><div><br></div><div>-Nick</div></font></span><div><div><br></div><br><blockquote type="cite"><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">


<div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 29, 2013 at 6:03 AM, Nick Kledzik<span> </span><span dir="ltr"><<a href="mailto:kledzik@apple.com" target="_blank">kledzik@apple.com</a>></span><span> </span>wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br><div><div>On Aug 27, 2013, at 5:56 PM, Virgile Bello <<a href="mailto:virgile.bello@gmail.com" target="_blank">virgile.bello@gmail.com</a>> wrote:</div>


<br><blockquote type="cite"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">Yes of course I understand it was done on purpose.</span><div style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">


It's just that it makes it impossible to include COFF.h and Windows.h side by side (which probably wasn't necessary until now).</div></blockquote><br></div></div><div>I too am in the camp that it is a feature to use the standard names.  For instance doing a search it google or github of the documented names will find uses.</div>


<div><br></div><div>Where exactly is the conflict happening?    Is the problem that something in llvm is including windows.h?  Or that some std lib C/C++ header is being included and the OS provided std header is including windows.h?  </div>


<span><font color="#888888"><div><br></div><div>-Nick</div></font></span></div></blockquote></div></div></div></blockquote></div></div><br></div></blockquote></div><br></div></div>