<div dir="ltr">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>And I'm a bit miffed that the commit description wrongly implicates C11 here.</div></div><br><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">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">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL364012: [libc++] Avoid using timespec when it might not be available (authored by miyuki, committed by ).<br>
Herald added a project: LLVM.<br>
Herald added a subscriber: llvm-commits.<br>
<br>
Changed prior to commit:<br>
<a href="https://reviews.llvm.org/D63328?vs=204745&id=205949#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/D63328?vs=204745&id=205949#toc</a><br>
<br>
Repository:<br>
rL LLVM<br>
<br>
CHANGES SINCE LAST ACTION<br>
<a href="https://reviews.llvm.org/D63328/new/" rel="noreferrer" target="_blank">https://reviews.llvm.org/D63328/new/</a><br>
<br>
<a href="https://reviews.llvm.org/D63328" rel="noreferrer" target="_blank">https://reviews.llvm.org/D63328</a><br>
<br>
Files:<br>
libcxx/trunk/include/__threading_support<br>
libcxx/trunk/src/condition_variable.cpp<br>
libcxx/trunk/src/support/win32/thread_win32.cpp<br>
<br>
<br>
Index: libcxx/trunk/include/__threading_support<br>
===================================================================<br>
--- libcxx/trunk/include/__threading_support<br>
+++ libcxx/trunk/include/__threading_support<br>
@@ -22,6 +22,8 @@<br>
# include <__external_threading><br>
#elif !defined(_LIBCPP_HAS_NO_THREADS)<br>
<br>
+typedef ::timespec __libcpp_timespec_t;<br>
+<br>
#if defined(_LIBCPP_HAS_THREAD_API_PTHREAD)<br>
# include <pthread.h><br>
# include <sched.h><br>
@@ -148,7 +150,7 @@<br>
<br>
_LIBCPP_THREAD_ABI_VISIBILITY _LIBCPP_NO_THREAD_SAFETY_ANALYSIS<br>
int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,<br>
- timespec *__ts);<br>
+ __libcpp_timespec_t *__ts);<br>
<br>
_LIBCPP_THREAD_ABI_VISIBILITY<br>
int __libcpp_condvar_destroy(__libcpp_condvar_t* __cv);<br>
@@ -287,7 +289,7 @@<br>
}<br>
<br>
int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,<br>
- timespec *__ts)<br>
+ __libcpp_timespec_t *__ts)<br>
{<br>
return pthread_cond_timedwait(__cv, __m, __ts);<br>
}<br>
@@ -356,7 +358,7 @@<br>
{<br>
using namespace chrono;<br>
seconds __s = duration_cast<seconds>(__ns);<br>
- timespec __ts;<br>
+ __libcpp_timespec_t __ts;<br>
typedef decltype(__ts.tv_sec) ts_sec;<br>
_LIBCPP_CONSTEXPR ts_sec __ts_sec_max = numeric_limits<ts_sec>::max();<br>
<br>
Index: libcxx/trunk/src/support/win32/thread_win32.cpp<br>
===================================================================<br>
--- libcxx/trunk/src/support/win32/thread_win32.cpp<br>
+++ libcxx/trunk/src/support/win32/thread_win32.cpp<br>
@@ -110,7 +110,7 @@<br>
}<br>
<br>
int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m,<br>
- timespec *__ts)<br>
+ __libcpp_timespec_t *__ts)<br>
{<br>
using namespace _VSTD::chrono;<br>
<br>
Index: libcxx/trunk/src/condition_variable.cpp<br>
===================================================================<br>
--- libcxx/trunk/src/condition_variable.cpp<br>
+++ libcxx/trunk/src/condition_variable.cpp<br>
@@ -60,7 +60,7 @@<br>
nanoseconds d = tp.time_since_epoch();<br>
if (d > nanoseconds(0x59682F000000E941))<br>
d = nanoseconds(0x59682F000000E941);<br>
- timespec ts;<br>
+ __libcpp_timespec_t ts;<br>
seconds s = duration_cast<seconds>(d);<br>
typedef decltype(ts.tv_sec) ts_sec;<br>
_LIBCPP_CONSTEXPR ts_sec ts_sec_max = numeric_limits<ts_sec>::max();<br>
<br>
<br>
</blockquote></div>