hanchenye-llvm-project/libcxx
Mikhail Maltsev cfdc7f0d7e [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
2019-06-21 08:33:47 +00:00
..
benchmarks [libc++][CMake] Refactor how we link against system libraries 2019-04-30 15:44:19 +00:00
cmake [libcxx][libcxxabi] Remove the unused CMake checks 2019-05-30 06:08:56 +00:00
docs Make GCC in C++03 Unsupported 2019-06-13 00:37:25 +00:00
fuzzing Update more file headers across all of the LLVM projects in the monorepo 2019-01-19 10:56:40 +00:00
include [libc++] Avoid using timespec when it might not be available 2019-06-21 08:33:47 +00:00
lib [libc++] Update ABI list for ABI v2 2019-06-17 19:37:26 +00:00
src [libc++] Avoid using timespec when it might not be available 2019-06-21 08:33:47 +00:00
test [libc++] Recommit r363692 to implement P0608R3 2019-06-20 22:09:40 +00:00
utils Reconfigure docker builders to be more modular. 2019-06-18 19:31:38 +00:00
www [libc++] Recommit r363692 to implement P0608R3 2019-06-20 22:09:40 +00:00
.arcconfig
.clang-format
.gitignore
CMakeLists.txt [runtimes] Check if pragma comment(lib, ...) is supported first 2019-05-30 04:40:21 +00:00
CREDITS.TXT
LICENSE.TXT Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
NOTES.TXT Reland "Use custom command and target to install libc++ headers" 2018-06-12 03:10:02 +00:00
TODO.TXT
appveyor-reqs-install.cmd Attempt to upgrade compiler used by appveyor builds 2019-04-03 20:40:01 +00:00
appveyor.yml disable appveyor config for MSVC 2015 2019-04-03 20:36:51 +00:00