<div dir="ltr">OK.  :)  We should avoid including windows.h from public headers anyway.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Oct 3, 2013 at 11:50 AM, Lars Viklund <span dir="ltr"><<a href="mailto:zao@acc.umu.se" target="_blank">zao@acc.umu.se</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, Oct 03, 2013 at 08:10:18AM +0200, Jonathan Sauer wrote:<br>
> Hello,<br>
><br>
> > support.h includes windows.h on win32 platform.<br>
> > Does libstdc++ also include windows.h. I think this single include may be enough to explain the difference.<br>
><br>
> I just looked into libc++, and it seems to include windows.h without first defining<br>
> WIN32_LEAN_AND_MEAN. From <<a href="http://support.microsoft.com/kb/166474" target="_blank">http://support.microsoft.com/kb/166474</a>>:<br>
><br>
> | WIN32_LEAN_AND_MEAN: Windows Headers use this symbol to exclude rarely-used header files<br>
><br>
> Maybe that's a way to speed things up a bit, at least on Windows.<br>
<br>
</div>No. NO. NEVER DO THIS.<br>
<br>
Defining that macro forces every single user of the Windows API to<br>
always include the Windows.h header themselves before you do, lest they<br>
will forever lose all ability to use very fundamental types in the<br>
Windows headers.<br>
<br>
That macro is for end user use only, and shall only be defined when all<br>
participating users agree on its use.<br>
<br>
"rarely-used" doesn't help the bloke that actually wanted to use HDROP<br>
or niche libraries like the ATL or WTL in that TU.<br>
<br>
If it's in your private libc++ library TUs, sure. But if it has _any_<br>
chance of leaking out into other code? No. Just don't.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Lars Viklund | <a href="mailto:zao@acc.umu.se">zao@acc.umu.se</a><br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<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></div>