summaryrefslogtreecommitdiffstats
path: root/libcxx/src/system_error.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Remove _LIBCPP_BUILDING_XXX macros, which are redundant since ↵Louis Dionne2018-08-011-1/+0
| | | | | | | | | | | | | | _LIBCPP_BUILDING_LIBRARY Summary: As suggested by Marshall in https://reviews.llvm.org/D49914 Reviewers: mclow.lists, EricWF Subscribers: christof, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50008 llvm-svn: 338475
* Rework libcxx strerror_r handling.James Y Knight2017-07-191-26/+46
| | | | | | | | | | | | | | | The set of #ifdefs used to handle the two incompatible variants of strerror_r were not complete (they didn't handle newlib appropriately). Rather than attempting to make the ifdefs more complex, make them unnecessary by choosing which behavior to use dependent upon the return type. Reviewers: waltl Differential Revision: https://reviews.llvm.org/D34294 llvm-svn: 308528
* Fix Libc++ build with MinGW64Eric Fiselier2017-05-311-1/+1
| | | | | | | | | | | | | | Summary: This patch corrects the build errors I encountered when building on MinGW64. Reviewers: mati865, rnk, compnerd, smeenai, bcraig Reviewed By: mati865, smeenai Subscribers: martell, chapuni, cfe-commits Differential Revision: https://reviews.llvm.org/D33082 llvm-svn: 304360
* Recommit [libcxx] Never use <cassert> within libc++Eric Fiselier2017-02-041-2/+2
| | | | | | | | | | It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead. Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to. llvm-svn: 294107
* Revert "[libcxx] Never use <cassert> within libc++"Eric Fiselier2017-01-241-2/+2
| | | | | | | | This reverts commit r292883. Unfortunately <string_view> uses _LIBCPP_ASSERT in a way which is not compatible with the C++11 dylib build. I'll investigate more tomorrow. llvm-svn: 292923
* [libcxx] Never use <cassert> within libc++Eric Fiselier2017-01-241-2/+2
| | | | | | | | | | | | | | | | | Summary: It is my opinion that libc++ should never use `<cassert>`, including in the `dylib`. This patch remove all uses of `assert` from within libc++ and replaces most of them with `_LIBCPP_ASSERT` instead. Additionally this patch turn `LIBCXX_ENABLE_ASSERTIONS` off by default, because the standard library should not be aborting user programs unless explicitly asked to. Reviewers: mclow.lists, compnerd, smeenai Reviewed By: mclow.lists Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D29063 llvm-svn: 292883
* Add ABI option to remove recently inlined __shared_count functions from the ↵Eric Fiselier2017-01-171-1/+1
| | | | | | | | | | | | | | library. In order to allow inlining of previously out-of-line functions without an ABI break libc++ provides legacy definitions in the dylib that old programs can continue to use. Unfortunatly Windows link.exe detects this hack and diagnoses the duplicate definitions. This patch disable the duplicate definitions on Windows by adding an ABI option which disables all "legacy out-of-line symbols" llvm-svn: 292190
* clean up use of _WIN32Saleem Abdulrasool2017-01-031-1/+1
| | | | | | | | | Replace the use of _WIN32 in libc++. Replace most use with a C runtime check _LIBCPP_MSVCRT or the new _LIBCPP_WIN32 to indicate that we are using the Win32 API. Use a new _LIBCPP_WCHAR_IS_UCS2 to indicate that we are on an environment that has a short wchar_t. llvm-svn: 290910
* system_error: provide a thread safe stringification for WindowsSaleem Abdulrasool2017-01-031-2/+10
| | | | | | | Provide a strerror_r replacement for Windows. This is needed to build libc++ for Windows with threading. llvm-svn: 290851
* Introduce _LIBCPP_DEPRECATED_ABI_EXTERNAL_ERROR_CATEGORY_CONSTRUCTOR ABI option.Eric Fiselier2017-01-021-0/+2
| | | | | | | | | | | | | Currently libc++ compiles a special version of error_category() into the dylib. This definition is no longer needed, and doesn't work on Windows due to dllimport/dllexport semantics. For those reasons this patch introduces an option to disable/enable this definition. By default the definition is provided in ABI v1 except on windows. This patch also addresses D28210. llvm-svn: 290840
* system_error: use strerror_r only for threaded codeSaleem Abdulrasool2016-12-311-0/+2
| | | | | | | | When building libc++ without threading, strerror_r is not used. Define the code only when threading is enabled. This allows us to build system_error for Windows, which ATM doesn't build with threading. llvm-svn: 290791
* Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception ↵Marshall Clow2016-08-251-0/+1
| | | | | | type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. llvm-svn: 279744
* Add an Android version check for GNU strerror_r.Dan Albert2016-06-151-1/+6
| | | | | | | | | | | | | | | | Summary: Android didn't gain GNU's strerror_r until Marshmallow. If we're building libc++ against something older (we build the NDK library against the oldest release we support, currently Gingerbread), fall back to the POSIX version. Reviewers: mclow.lists, EricWF Subscribers: tberghammer, danalbert, srhines, cfe-commits Differential Revision: http://reviews.llvm.org/D21402 llvm-svn: 272827
* Fix syntax error in r272640.Eric Fiselier2016-06-141-1/+2
| | | | llvm-svn: 272641
* Fix error checking for strerror_r implementations that return the error code.Eric Fiselier2016-06-141-2/+4
| | | | llvm-svn: 272640
* Make system_error::message() thread safe. Fixes PR25598.Eric Fiselier2016-06-141-1/+48
| | | | | | | | | | | | | | | | | | | | Summary: system_error::message() uses `strerror` for the generic and system categories. This function is not thread safe. The fix is to use `strerror_r`. It has been available since 2001 for GNU libc and since BSD 4.4 on FreeBSD/OS X. On platforms with GNU libc the extended version is used which always returns a valid string, even if an error occurs. In single-threaded builds `strerror` is still used. See https://llvm.org/bugs/show_bug.cgi?id=25598 Reviewers: majnemer, mclow.lists Subscribers: erik65536, cfe-commits, emaste Differential Revision: http://reviews.llvm.org/D20903 llvm-svn: 272633
* Move atomic_support.h and config_elast.h into src/includeEric Fiselier2015-08-181-1/+1
| | | | llvm-svn: 245354
* Fix -Wpessimizing-move warning by remove the call to std::move.Richard Trieu2015-04-301-1/+1
| | | | llvm-svn: 236265
* [libcxx] Set _LIBCPP_ELAST for mingw.Dan Albert2015-01-061-2/+5
| | | | | | | | | | | | Reviewers: K-ballo, mclow.lists, EricWF Reviewed By: EricWF Subscribers: jfb, jroelofs, majnemer, cfe-commits Differential Revision: http://reviews.llvm.org/D6558 llvm-svn: 225273
* Newlib names ELAST differently than linuxJonathan Roelofs2014-09-021-18/+10
| | | | llvm-svn: 216943
* Linux: Correctly identify valid error codesDavid Majnemer2014-05-291-0/+9
| | | | | | | | | | | | | | [syserr.errcat.objects]p4 specifies that system_category().default_error_condition(ev) map to error_condition(posv, generic_category()) if ev could map to a POSIX errno. Linux reserves up to and including 4095 for errno values, use this as a bound. This fixes syserr.errcat.objects/system_category.pass.cpp on Linux. llvm-svn: 209795
* Replace a tab with a spaceDavid Majnemer2014-03-171-1/+1
| | | | llvm-svn: 204077
* LWG 2145 - mark constructor for std::error_category as inline and constexpr. ↵Marshall Clow2013-08-211-0/+1
| | | | | | Leave the (existing, out-of-line, non-constexpr) in the dylib for compatibility with existing programs) llvm-svn: 188858
* Fix a few warnings/errors for compiling with -fno-exceptions.Howard Hinnant2013-03-281-0/+3
| | | | llvm-svn: 178267
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-301-1/+1
| | | | llvm-svn: 134190
* Applied noexcept to everything in [diagnostics] (Chapter 19)Howard Hinnant2011-05-261-14/+14
| | | | llvm-svn: 132137
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* Fixing whitespace problemsHoward Hinnant2010-08-221-3/+3
| | | | llvm-svn: 111751
* now works with -fno-exceptions and -fno-rttiHoward Hinnant2010-08-111-0/+2
| | | | llvm-svn: 110828
* patch by Jeffrey Yasskin for porting to Ubuntu Hardy. Everything was ↵Howard Hinnant2010-05-241-9/+15
| | | | | | accepted except there were some bug fixes needed in <locale> for the __nolocale_* series. For the apple branch I ended up using templates instead of the var_args solution because it seemed both safer and more efficient. llvm-svn: 104516
* 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/+193
llvm-svn: 103490
OpenPOWER on IntegriCloud