aboutsummaryrefslogtreecommitdiff
path: root/libcxx/src/system_error.cpp
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-02-04 23:22:28 +0000
committerEric Fiselier <eric@efcs.ca>2017-02-04 23:22:28 +0000
commite49cdfbeea99ba94ed3d8a46b9943b272dbd9c5f (patch)
tree7dc16aa7afd24344bb01d80de74782ba169461a1 /libcxx/src/system_error.cpp
parent5ddaeb888d807b5512546d5f666a581afddde6cc (diff)
downloadllvm-e49cdfbeea99ba94ed3d8a46b9943b272dbd9c5f.zip
llvm-e49cdfbeea99ba94ed3d8a46b9943b272dbd9c5f.tar.gz
llvm-e49cdfbeea99ba94ed3d8a46b9943b272dbd9c5f.tar.bz2
Recommit [libcxx] Never use <cassert> within libc++
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
Diffstat (limited to 'libcxx/src/system_error.cpp')
-rw-r--r--libcxx/src/system_error.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libcxx/src/system_error.cpp b/libcxx/src/system_error.cpp
index 9411499..cbbbb5d 100644
--- a/libcxx/src/system_error.cpp
+++ b/libcxx/src/system_error.cpp
@@ -17,9 +17,9 @@
#include "cstring"
#include "cstdio"
#include "cstdlib"
-#include "cassert"
#include "string"
#include "string.h"
+#include "__debug"
#if defined(__ANDROID__)
#include <android/api-level.h>
@@ -96,7 +96,7 @@ string do_strerror_r(int ev) {
std::snprintf(buffer, strerror_buff_size, "Unknown error %d", ev);
return string(buffer);
} else {
- assert(new_errno == ERANGE);
+ _LIBCPP_ASSERT(new_errno == ERANGE, "unexpected error from ::strerr_r");
// FIXME maybe? 'strerror_buff_size' is likely to exceed the
// maximum error size so ERANGE shouldn't be returned.
std::abort();