hanchenye-llvm-project/libcxx/include
Ed Schouten e0cf3b9a3c Make support for thread-unsafe C functions optional.
One of the aspects of CloudABI is that it aims to help you write code
that is thread-safe out of the box. This is very important if you want
to write libraries that are easy to reuse. For CloudABI we decided to
not provide the thread-unsafe functions. So far this is working out
pretty well, as thread-unsafety issues are detected really early on.

The following patch adds a knob to libc++,
_LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS, that can be set to disable
thread-unsafe functions that can easily be avoided in practice. The
following functions are not thread-safe:

- <clocale>: locale handles should be preferred over setlocale().
- <cstdlib>: mbrlen(), mbrtowc() and wcrtomb() should be preferred over
  their non-restartable counterparts.
- <ctime>: asctime(), ctime(), gmtime() and localtime() are not
  thread-safe. The first two are also deprecated by POSIX.

Differential Revision:	http://reviews.llvm.org/D8703
Reviewed by:	marshall

llvm-svn: 240527
2015-06-24 08:44:38 +00:00
..
experimental Implement std::experimental::sample. 2015-05-13 16:55:41 +00:00
ext [libcxx] Fix detection of __is_final. 2015-06-13 07:08:02 +00:00
support cmath: account for MSVCRT 12.0 changes 2015-02-28 20:18:39 +00:00
CMakeLists.txt Add option to turn off installation of headers. 2014-12-12 22:52:58 +00:00
__bit_reference Get tests running with warnings. Fix warnings in headers and tests 2015-02-05 20:28:37 +00:00
__config Make support for thread-unsafe C functions optional. 2015-06-24 08:44:38 +00:00
__debug Print log/error messages on stderr, not stdout 2015-03-10 07:57:43 +00:00
__functional_03 Fix std::function allocator constructors in C++03. 2015-06-14 23:30:09 +00:00
__functional_base Remove constexpr support for std::apply because it introduces regressions. 2015-04-19 15:32:52 +00:00
__functional_base_03 [libcxx] Fix PR 22468 - std::function<void()> does not accept non-void-returning functions 2015-02-10 16:48:45 +00:00
__hash_table Fix PR12999 - unordered_set::insert calls operator new when no insert occurs 2015-06-13 07:18:32 +00:00
__locale Fix ctype_byname<wchar_t>::do_is() mask checking.... again 2015-03-11 17:00:28 +00:00
__mutex_base Allow libc++ to be built on systems without POSIX threads 2014-09-05 19:45:05 +00:00
__refstring Fix some -Wundef issues. 2015-02-05 02:34:59 +00:00
__split_buffer G M: Changes all references to "x inline" to "inline x" where x = _libcpp_always_inline or _libcpp_inline_visibility macros. 2013-10-04 22:09:00 +00:00
__sso_allocator Handle function name conflicts in _LIBCPP_MSVCRT mode 2015-02-13 22:15:32 +00:00
__std_stream
__tree In many places, there was an #ifdef/#else block that selected one of two implmentations of rebind_alloc based on whether or not we had template aliases. Create a helper struct to encapsulate that bit of logic, and replace all the ifdefs with uses of that struct. No functionality change intented. 2015-04-07 05:21:38 +00:00
__tuple [libcxx] Move tuple_size and tuple_element overloads for pair and array out of !defined(_LIBCPP_HAS_NO_VARIADICS) block. 2015-03-17 15:08:03 +00:00
__undef___deallocate Handle function name conflicts in _LIBCPP_MSVCRT mode 2015-02-13 22:15:32 +00:00
__undef_min_max Fix-it suggestion for fixing min or max defines on Windows. 2013-11-15 23:41:01 +00:00
algorithm Fix some places where we could call memmove(null,xxx,0) - which is UB 2015-06-02 13:52:16 +00:00
array [libcxx] Move tuple_size and tuple_element overloads for pair and array out of !defined(_LIBCPP_HAS_NO_VARIADICS) block. 2015-03-17 15:08:03 +00:00
atomic Prevent dependancy on libatomic when using GCC to provide <atomic>. 2015-06-13 00:23:07 +00:00
bitset Make locales (and transitively, std::endl) work reliably with gcc. 2014-06-04 15:46:56 +00:00
cassert
ccomplex
cctype cctype: tweak inclusions for _LIBCPP_MSVCRT case 2015-02-13 22:15:28 +00:00
cerrno
cfenv
cfloat
chrono Partially address a FIXME in steady_clock::now() 2014-09-02 21:14:38 +00:00
cinttypes Make *abs() and *div() work on CloudABI. 2015-03-16 14:27:44 +00:00
ciso646
climits
clocale Make support for thread-unsafe C functions optional. 2015-06-24 08:44:38 +00:00
cmath Provide std::abs(<floating-point>) in <cmath> on Solaris. 2015-03-18 15:24:18 +00:00
codecvt
complex Implement literal suffixes for compled 2013-10-05 21:19:49 +00:00
complex.h
condition_variable Allow libc++ to be built on systems without POSIX threads 2014-09-05 19:45:05 +00:00
csetjmp
csignal
cstdarg
cstdbool
cstddef Update cstddef after clang r207606. 2014-05-16 01:45:02 +00:00
cstdint
cstdio Make the presence of stdin and stdout optional. 2015-03-26 14:35:46 +00:00
cstdlib Make support for thread-unsafe C functions optional. 2015-06-24 08:44:38 +00:00
cstring Make support for thread-unsafe C functions optional. 2015-06-24 08:44:38 +00:00
ctgmath
ctime Make support for thread-unsafe C functions optional. 2015-06-24 08:44:38 +00:00
cwchar Make the presence of stdin and stdout optional. 2015-03-26 14:35:46 +00:00
cwctype
deque Fix PR#23767. Add tests for iterator invalidation for deque::erase/pop_front/pop_back 2015-06-05 22:34:19 +00:00
exception [libcxx] Fix detection of __is_final. 2015-06-13 07:08:02 +00:00
forward_list In many places, there was an #ifdef/#else block that selected one of two implmentations of rebind_alloc based on whether or not we had template aliases. Create a helper struct to encapsulate that bit of logic, and replace all the ifdefs with uses of that struct. No functionality change intented. 2015-04-07 05:21:38 +00:00
fstream Add option to disable access to the global filesystem namespace. 2015-03-12 15:44:39 +00:00
functional Rename internal trait that used non-reserved name. 2015-05-19 22:27:18 +00:00
future Fix PR23293 - Do not unlock shared state before notifying consumers. 2015-06-12 00:41:34 +00:00
initializer_list
iomanip Implement LWG #2344: quoted()'s interaction with padding is unclear. I think that anyone using quoted with padding is really confused, but it should work the way the rest of iostreams works. 2014-03-07 21:45:32 +00:00
ios Address some post-commit review comments on r217261 2014-09-05 20:28:44 +00:00
iosfwd Revert: Revert r227804: Use fseek/ftell instead of fseeko/ftello when Newlib is the libc 2015-02-03 15:34:17 +00:00
iostream Make the presence of stdin and stdout optional. 2015-03-26 14:35:46 +00:00
istream K-ballo pointed out *another* mistype in my change 2014-09-17 01:58:15 +00:00
iterator A few bits of N2994 didn't get fully implemented a long time ago. Thanks to STL@microsoft.com for the bug report 2015-04-16 21:36:54 +00:00
limits libc++: integral types trap on PNaCl 2014-11-26 17:51:58 +00:00
list In many places, there was an #ifdef/#else block that selected one of two implmentations of rebind_alloc based on whether or not we had template aliases. Create a helper struct to encapsulate that bit of logic, and replace all the ifdefs with uses of that struct. No functionality change intented. 2015-04-07 05:21:38 +00:00
locale Add support for kfreebsd. Thanks to Jan Henke 2015-03-19 09:03:58 +00:00
map [libcxx] Fix detection of __is_final. 2015-06-13 07:08:02 +00:00
memory Fix illegal chars that snuck into <memory> 2015-06-19 19:32:06 +00:00
module.modulemap Handle function name conflicts in _LIBCPP_MSVCRT mode 2015-02-13 22:15:32 +00:00
mutex LWG2442: call_once() shouldn't DECAY_COPY(). Patch from K-Ballo. 2015-06-13 02:23:00 +00:00
new [libcxx] Rework sized delete. 2015-05-19 02:03:22 +00:00
numeric [libcxx] Fix use of operator comma where the types can be user defined 2014-10-27 19:28:20 +00:00
ostream Make seeking on an ostream that has eofbit set work correctly. Fixes PR#21361 2015-06-22 15:01:21 +00:00
queue Move the default template arguments into the forward declarations for the container adapters: stack and queue. References PR#22605. 2015-02-18 17:51:56 +00:00
random Add support for arc4random() to random_device. 2015-03-10 07:46:06 +00:00
ratio Fix building and testing libc++ with GCC. 2015-05-20 03:15:01 +00:00
regex Add code to honor the match_not_bol and match_not_eol regex flats. Fixes PR#22651. Thanks to Jim Porter for the report and suggested fix. 2015-03-19 17:05:59 +00:00
scoped_allocator Add 'is_always_equal' tests for scoped_allocator. Found that I had typed '||' where I meant '&&' in the code; fixed that, too 2015-06-03 16:15:55 +00:00
set Fix for LWG Issue 2059: C++0x ambiguity problem with map::erase 2015-05-10 13:35:00 +00:00
shared_mutex [libcxx] Fix bug in shared_timed_mutex that could cause a program to hang. 2015-04-02 21:02:06 +00:00
sstream Fix a bug in the move-assigment operator for basic_stringbuf. Thanks to Johnathan Wakeley for the bug report 2014-09-16 18:57:52 +00:00
stack Move the default template arguments into the forward declarations for the container adapters: stack and queue. References PR#22605. 2015-02-18 17:51:56 +00:00
stdexcept Fix unused private field warning in stdexcept after r207695. 2015-02-05 07:40:48 +00:00
streambuf Make basic_streambuf::xsputn write characters in chunks whenever possible, instead of one at a time. References PR#10193 2015-02-19 16:17:46 +00:00
string While applying N4258, I forgot about LWG#2455, which modified the modifications. Correct those - h/t: Howard 2015-06-04 02:05:41 +00:00
strstream
system_error
tgmath.h
thread Explicitly include <sched.h> for sched_yield() 2014-12-08 14:50:21 +00:00
tuple [libcxx] Fix detection of __is_final. 2015-06-13 07:08:02 +00:00
type_traits Cleanup result_of tests and fix issues with the C++03 result_of. 2015-06-13 08:25:24 +00:00
typeindex
typeinfo RTTI Uniqueness: remove __name_for_load function. 2014-04-03 09:12:38 +00:00
unordered_map [libcxx] Fix detection of __is_final. 2015-06-13 07:08:02 +00:00
unordered_set Fix for LWG Issue 2059: C++0x ambiguity problem with map::erase 2015-05-10 13:35:00 +00:00
utility [libcxx] Move tuple_size and tuple_element overloads for pair and array out of !defined(_LIBCPP_HAS_NO_VARIADICS) block. 2015-03-17 15:08:03 +00:00
valarray Handle function name conflicts in _LIBCPP_MSVCRT mode 2015-02-13 22:15:32 +00:00
vector While applying N4258, I forgot about LWG#2455, which modified the modifications. Correct those - h/t: Howard 2015-06-04 02:05:41 +00:00