<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 20, 2019 at 1:52 AM Michael Platings via Phabricator <<a href="mailto:reviews@reviews.llvm.org">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">michaelplatings added a comment.<br>
<br>
In D66301#1636506 <<a href="https://reviews.llvm.org/D66301#1636506" rel="noreferrer" target="_blank">https://reviews.llvm.org/D66301#1636506</a>>, @zoecarver wrote:<br>
<br>
> Isn't that the intent? It looks like it's just conditionally adding an `#include`.<br>
<br>
<br>
No, that's not the intent. There may be some misunderstanding going on here so I'll have a go at explaining the intent in my own words (I worked with David on this patch).<br>
<br>
Near the top of the file there's:<br>
<br>
  #if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)<br>
  # include <__external_threading><br>
  #elif !defined(_LIBCPP_HAS_NO_THREADS)<br>
<br>
this was followed by the rest of the code in the header. Since __thread_id et al. was moved into this header from another header (about a week ago), it's only compiled if neither _LIBCPP_HAS_THREAD_API_EXTERNAL nor _LIBCPP_HAS_NO_THREADS are defined whereas previously it had been compiled irrespective of _LIBCPP_HAS_THREAD_API_EXTERNAL.<br>
To restore the previous behaviour, we're ending the #if block (`#endif // !_LIBCPP_HAS_NO_THREADS and !_LIBCPP_HAS_THREAD_API_EXTERNAL`) and starting a new one (`#if !defined(_LIBCPP_HAS_NO_THREADS)`), which removes the _LIBCPP_HAS_THREAD_API_EXTERNAL condition.<br>
<br>
The _LIBCPP_END_NAMESPACE_STD stuff we're adding is only there to make sure there isn't a mismatch in the number of times we open or close the namespace, or push or pop macros.<br>
<br>
Hope that makes things clearer.</blockquote><div><br></div><div>I have put up <a href="https://reviews.llvm.org/D66480">https://reviews.llvm.org/D66480</a> as an alternative fix.</div><div><br></div><div>-- Marshall</div><div> </div></div></div>