<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 23, 2009, at 11:48 AM, John Thompson wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>That (__has_include etc.) sounds good.  I'm assuming that is for use in a #if?</div></blockquote><div><br></div><div>Yes, just like __has_builtin and __has_feature.</div><div><br></div><div>It probably makes sense to allow the same forms as include directives, e.g.,</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">     </span>__has_include(<stdlib.h>)</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>__has_include("stdlib.h")</div><div><div><span class="Apple-tab-span" style="white-space: pre; ">    </span>__has_include_next(<stdlib.h>)</div><div><span class="Apple-tab-span" style="white-space: pre; ">      </span>__has_include_next("stdlib.h")</div><div><br></div></div><br><blockquote type="cite">
<div>Would you like me to take a stab at it><br></div></blockquote><div><br></div><div>That would be great!</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">   </span>- Doug</div><br><blockquote type="cite">
<div>-John<br></div>
<div class="gmail_quote">On Fri, Oct 23, 2009 at 9:33 AM, Douglas Gregor <span dir="ltr"><<a href="mailto:dgregor@apple.com">dgregor@apple.com</a>></span> wrote:<br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<div class="im"><br>On Oct 23, 2009, at 9:10 AM, Daniel Dunbar wrote:<br><br>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">On Thu, Oct 15, 2009 at 5:23 PM, Douglas Gregor <<a href="mailto:dgregor@apple.com" target="_blank">dgregor@apple.com</a>> wrote:<br>

<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Also, could someone look at the enclosed patch for stdint.h?  This also<br>fixes some failing tests, since VC++ doesn't have stdint.h.  Who is point on<br>
this?<br></blockquote><br>I'm not thrilled about using _M_IX86 and _M_X64 to detect what is really a<br>library issue. I guess in the worst case we could have a configure-time<br>check that determines whether we can #include_next <stdint.h>, but<br>
that's.... horrible.<br>Unless someone has a better idea... ?<br></blockquote><br>No configure-time check. :P<br><br>We could always invent a clang specific internal define for this,<br>which targets can set in their predefines. For example,<br>
__STDC_INCLUDES_STDINT__ or so.<br></blockquote><br><br></div>It seems to me that target information should be limited to information about the ABI, linker, assembler, and other parts of the toolchain, but not the (C or C++) standard library, since standard libraries are meant to be interchangeable.<br>
<br>However, I have an idea. Clang's <stdint.h> looks like this:<br><br>/* If we're hosted, fall back to the system's stdint.h, which might have<br> * additional definitions.<br> */<br>#if __STDC_HOSTED__<br>
# include_next <stdint.h><br>#else<br>// our own definitions of <stdint.h><br>#endif<br><br>why not add new __has_include and __has_include_next preprocessor primitives, so that we can *really* detect whether we have a system <stdint.h>?<br>
<br>This also gets us closer to eliminating the need for configure :D<br><br>       - Doug<br></blockquote></div><br><br clear="all">
<div></div><br>-- <br>John Thompson<br><a href="mailto:John.Thompson.JTSoftware@gmail.com">John.Thompson.JTSoftware@gmail.com</a><br><br>
</blockquote></div><br></body></html>