diff options
| author | Mikhail Maltsev <mikhail.maltsev@arm.com> | 2019-06-21 08:33:47 +0000 |
|---|---|---|
| committer | Mikhail Maltsev <mikhail.maltsev@arm.com> | 2019-06-21 08:33:47 +0000 |
| commit | cfdc7f0d7e25612700b1003b438b45ea2fe6e244 (patch) | |
| tree | 9e82c37131284624e5884abea9d952f1e40775c2 /libcxx/src/support | |
| parent | dea9d57d95b94f3305338e4c4123569b1a8f245c (diff) | |
| download | bcm5719-llvm-cfdc7f0d7e25612700b1003b438b45ea2fe6e244.tar.gz bcm5719-llvm-cfdc7f0d7e25612700b1003b438b45ea2fe6e244.zip | |
[libc++] Avoid using timespec when it might not be available
Summary:
The type timespec is unconditionally used in __threading_support.
Since the C library is only required to provide it in C11, this might
cause problems for platforms with external thread porting layer (i.e.
when _LIBCPP_HAS_THREAD_API_EXTERNAL is defined) with pre-C11
C libraries.
In our downstream port of libc++ we used to provide a definition of
timespec in __external_threading, but this solution is not ideal
because timespec is not a reserved name.
This patch renames timespec into __libcpp_timespec_t in the
thread-related parts of libc++. For all cases except external
threading this type is an alias for ::timespec (and no functional
changes are intended).
In case of external threading it is expected that the
__external_threading header will either provide a similar typedef (if
timespec is available in the vendor's C library) or provide a
definition of __libcpp_timespec_t compatible with POSIX timespec.
Reviewers: ldionne, mclow.lists, EricWF
Reviewed By: ldionne
Subscribers: dexonsmith, libcxx-commits, christof, carwil
Tags: #libc
Differential Revision: https://reviews.llvm.org/D63328
llvm-svn: 364012
Diffstat (limited to 'libcxx/src/support')
| -rw-r--r-- | libcxx/src/support/win32/thread_win32.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/src/support/win32/thread_win32.cpp b/libcxx/src/support/win32/thread_win32.cpp index 3ca36df808f..83e7e9f6ce5 100644 --- a/libcxx/src/support/win32/thread_win32.cpp +++ b/libcxx/src/support/win32/thread_win32.cpp @@ -110,7 +110,7 @@ int __libcpp_condvar_wait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m) } int __libcpp_condvar_timedwait(__libcpp_condvar_t *__cv, __libcpp_mutex_t *__m, - timespec *__ts) + __libcpp_timespec_t *__ts) { using namespace _VSTD::chrono; |

