summaryrefslogtreecommitdiffstats
path: root/libcxx/include/cstring
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Fix overload sets of strchr, strpbrk, strrchr, memchr and strstr fromRichard Smith2016-02-101-17/+0
| | | | | | | | | | | | | | | | | <string.h> and wcschr, wcspbrk, wcsrchr, wmemchr, and wcsstr from <wchar.h> to provide a const-correct overload set even when the underlying C library does not. This change adds a new macro, _LIBCPP_PREFERRED_OVERLOAD, which (if defined) specifies that a given overload is a better match than an otherwise equally good function declaration without the overload. This is implemented in modern versions of Clang via __attribute__((enable_if)), and not elsewhere. We use this new macro to define overloads in the global namespace for these functions that displace the overloads provided by the C library, unless we believe the C library is already providing the correct signatures. llvm-svn: 260337
* Revert r249929 ("Split <string.h> out of <cstring>").Richard Smith2015-10-291-23/+18
| | | | | | | | | | | | | | This change caused problems when building code like povray that: a) uses 'using namespace std;' b) is built on an environment where the C library provides the "wrong" (non-const-correct) interface for the str* functions c) makes an unqualified call to one of those str* functions A patch is out for review to add a facility to fix this (and to give the correct signatures for these functions whenever possible, even when the C library does not do so). This revert is expected to be temporary. llvm-svn: 251665
* Split <string.h> out of <cstring>.Richard Smith2015-10-101-18/+23
| | | | | | | | Also fix the overload set for the five functions whose signatures change in the case where we can fix it. This is already covered by existing tests for the affected systems. llvm-svn: 249929
* Make support for thread-unsafe C functions optional.Ed Schouten2015-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert changes inadvertantly committedMarshall Clow2015-06-021-23/+4
| | | | llvm-svn: 238880
* Move uncaught_exeption() definition inside the #ifdef block like ↵Marshall Clow2015-06-021-4/+23
| | | | | | uncaught_exceptions() llvm-svn: 238879
* Nico Rieck: Currently _MSC_VER and _WIN32 are used to guard code which isHoward Hinnant2013-08-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | MSVC-specific, MSVCRT-specific, or Windows-specific. Because Clang can also define _MSC_VER, and MSVCRT is not necessarily the only C runtime, these macros should not be used interchangeably. This patch divides all Windows-related bits into the aforementioned categories. Two new macros are introduced: - _LIBCPP_MSVC: Defined when compiling with MSVC. Detected using _MSC_VER, excluding Clang. - _LIBCPP_MSVCRT: Defined when using the Microsoft CRT. This is the default when _WIN32 is defined. This leaves _WIN32 for code using the Windows API. This also corrects the spelling of _LIBCP_HAS_IS_BASE_OF to _LIBCPP_HAS_IS_BASE_OF. Nico, please prepare a patch for CREDITS.TXT, thanks. llvm-svn: 187593
* Change <cwchar> and <cstring> to look out for flags which may or may not be ↵Howard Hinnant2013-04-081-1/+1
| | | | | | set by the C headers <wchar.h> and <string.h> indicating C support for the C++-altered wcschr, wcspbrk, wcsrchr, wcsstr, wmemchr, strchr, strpbrk, strrchr, memchr, and strstr. This was already done in <cstring> for other platforms using other flags, so just had to add one more flag to the list there. llvm-svn: 179041
* Solaris port. Currently sees around 200 test failures, mostly related toDavid Chisnall2012-02-291-1/+1
| | | | | | | | | | Solaris not providing some of the locales that the test suite uses. Note: This depends on an xlocale (partial) implementation for Solaris and a couple of fixed standard headers. These will be committed to a branch later today. llvm-svn: 151720
* More windows port work by Ruben Van BoxemHoward Hinnant2011-10-221-1/+2
| | | | llvm-svn: 142732
* Windows support by Ruben Van Boxem.Howard Hinnant2011-10-171-0/+2
| | | | llvm-svn: 142235
* Bug 7983 fixed by Bernhard RosenkraenzerHoward Hinnant2010-10-141-4/+7
| | | | llvm-svn: 116487
* Fixing whitespace problemsHoward Hinnant2010-08-221-1/+1
| | | | llvm-svn: 111750
* Fix conflict with cstring and using namespace stdHoward Hinnant2010-08-101-5/+5
| | | | llvm-svn: 110736
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+106
llvm-svn: 103490
OpenPOWER on IntegriCloud