<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 21, 2019, at 05:21, Eric Fiselier <<a href="mailto:eric@efcs.ca" class="">eric@efcs.ca</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Yeah, I don't think the patch is inconsistent. But I want to know why timespec isn't being provided by the system headers implementing POSIX.</div></div></blockquote><div><br class=""></div><div>I don't understand. After the patch, the only place where we don't assume timespec is provided by the underlying system is when when __external_threading is included, right? The way I understanding this patch, we're just not making an assumption that <__external_threading> is naming `timespec` as `::timespec`, and instead we're providing a level of indirection that <__external_threading> can use to define that type for us.</div><div><br class=""></div><div>I think I'm missing your concern, please explain if that's the case.</div><div><br class=""></div><div>Louis</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">And I'm a bit miffed that the commit description wrongly implicates C11 here.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jun 21, 2019 at 4:30 AM Mikhail Maltsev via Phabricator <<a href="mailto:reviews@reviews.llvm.org" class="">reviews@reviews.llvm.org</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">This revision was automatically updated to reflect the committed changes.<br class="">
Closed by commit rL364012: [libc++] Avoid using timespec when it might not be available (authored by miyuki, committed by ).<br class="">
Herald added a project: LLVM.<br class="">
Herald added a subscriber: llvm-commits.<br class="">
<br class="">
Changed prior to commit:<br class="">
  <a href="https://reviews.llvm.org/D63328?vs=204745&id=205949#toc" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D63328?vs=204745&id=205949#toc</a><br class="">
<br class="">
Repository:<br class="">
  rL LLVM<br class="">
<br class="">
CHANGES SINCE LAST ACTION<br class="">
  <a href="https://reviews.llvm.org/D63328/new/" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D63328/new/</a><br class="">
<br class="">
<a href="https://reviews.llvm.org/D63328" rel="noreferrer" target="_blank" class="">https://reviews.llvm.org/D63328</a><br class="">
<br class="">
Files:<br class="">
  libcxx/trunk/include/__threading_support<br class="">
  libcxx/trunk/src/condition_variable.cpp<br class="">
  libcxx/trunk/src/support/win32/thread_win32.cpp<br class="">
<br class="">
<br class="">
Index: libcxx/trunk/include/__threading_support<br class="">
===================================================================<br class="">
--- libcxx/trunk/include/__threading_support<br class="">
+++ libcxx/trunk/include/__threading_support<br class="">
@@ -22,6 +22,8 @@<br class="">
 # include <__external_threading><br class="">
 #elif !defined(_LIBCPP_HAS_NO_THREADS)<br class="">
<br class="">
+typedef ::timespec __libcpp_timespec_t;<br class="">
+<br class="">
 #if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)<br class="">
 # include <pthread.h><br class="">
 # include <sched.h><br class="">
@@ -148,7 +150,7 @@<br class="">
<br class="">
 _LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS<br class="">
 int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,<br class="">
-                               timespec *__ts);<br class="">
+                               __libcpp_timespec_t *__ts);<br class="">
<br class="">
 _LIBCPP_THREAD_ABI_VISIBILITY<br class="">
 int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv);<br class="">
@@ -287,7 +289,7 @@<br class="">
 }<br class="">
<br class="">
 int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,<br class="">
-                               timespec *__ts)<br class="">
+                               __libcpp_timespec_t *__ts)<br class="">
 {<br class="">
   return pthread_cond_timedwait(__cv, __m, __ts);<br class="">
 }<br class="">
@@ -356,7 +358,7 @@<br class="">
 {<br class="">
    using namespace chrono;<br class="">
    seconds __s = duration_cast<seconds>(__ns);<br class="">
-   timespec __ts;<br class="">
+   __libcpp_timespec_t __ts;<br class="">
    typedef decltype(__ts.tv_sec) ts_sec;<br class="">
    _LIBCPP_CONSTEXPR ts_sec __ts_sec_max = numeric_limits<ts_sec>::max();<br class="">
<br class="">
Index: libcxx/trunk/src/support/win32/thread_win32.cpp<br class="">
===================================================================<br class="">
--- libcxx/trunk/src/support/win32/thread_win32.cpp<br class="">
+++ libcxx/trunk/src/support/win32/thread_win32.cpp<br class="">
@@ -110,7 +110,7 @@<br class="">
 }<br class="">
<br class="">
 int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,<br class="">
-                               timespec *__ts)<br class="">
+                               __libcpp_timespec_t *__ts)<br class="">
 {<br class="">
   using namespace _VSTD::chrono;<br class="">
<br class="">
Index: libcxx/trunk/src/condition_variable.cpp<br class="">
===================================================================<br class="">
--- libcxx/trunk/src/condition_variable.cpp<br class="">
+++ libcxx/trunk/src/condition_variable.cpp<br class="">
@@ -60,7 +60,7 @@<br class="">
     nanoseconds d = tp.time_since_epoch();<br class="">
     if (d > nanoseconds(0x59682F000000E941))<br class="">
         d = nanoseconds(0x59682F000000E941);<br class="">
-    timespec ts;<br class="">
+    __libcpp_timespec_t ts;<br class="">
     seconds s = duration_cast<seconds>(d);<br class="">
     typedef decltype(ts.tv_sec) ts_sec;<br class="">
     _LIBCPP_CONSTEXPR ts_sec ts_sec_max = numeric_limits<ts_sec>::max();<br class="">
<br class="">
<br class="">
</blockquote></div>
</div></blockquote></div><br class=""></body></html>