summaryrefslogtreecommitdiff
path: root/absl
diff options
context:
space:
mode:
Diffstat (limited to 'absl')
-rw-r--r--absl/base/BUILD.bazel9
-rw-r--r--absl/base/CMakeLists.txt9
-rw-r--r--absl/base/config.h9
-rw-r--r--absl/strings/escaping_test.cc11
4 files changed, 34 insertions, 4 deletions
diff --git a/absl/base/BUILD.bazel b/absl/base/BUILD.bazel
index 1a18f5f7..e825de0c 100644
--- a/absl/base/BUILD.bazel
+++ b/absl/base/BUILD.bazel
@@ -47,6 +47,15 @@ cc_library(
)
cc_library(
+ name = "raw_logging_internal",
+ copts = ABSL_DEFAULT_COPTS,
+ linkopts = ABSL_DEFAULT_LINKOPTS,
+ visibility = [
+ "//absl:__subpackages__",
+ ],
+)
+
+cc_library(
name = "spinlock_wait",
srcs = [
"internal/spinlock_akaros.inc",
diff --git a/absl/base/CMakeLists.txt b/absl/base/CMakeLists.txt
index 8417556c..9ff80738 100644
--- a/absl/base/CMakeLists.txt
+++ b/absl/base/CMakeLists.txt
@@ -34,7 +34,14 @@ absl_cc_library(
absl::core_headers
COPTS
${ABSL_DEFAULT_COPTS}
-)
+)
+
+absl_cc_library(
+ NAME
+ raw_logging_internal
+ COPTS
+ ${ABSL_DEFAULT_COPTS}
+)
absl_cc_library(
NAME
diff --git a/absl/base/config.h b/absl/base/config.h
index 692738e3..181d840e 100644
--- a/absl/base/config.h
+++ b/absl/base/config.h
@@ -375,12 +375,17 @@
// https://github.com/abseil/abseil-cpp/issues/207 and
// https://developer.apple.com/documentation/xcode_release_notes/xcode_10_release_notes
// libc++ spells out the availability requirements in the file
-// llvm-project/libcxx/include/__config.
+// llvm-project/libcxx/include/__config via the #define
+// _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS.
#if defined(__APPLE__) && defined(_LIBCPP_VERSION) && \
((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && \
__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101400) || \
(defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && \
- __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 101200))
+ __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ < 120000) || \
+ (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ < 120000) || \
+ (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && \
+ __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ < 50000))
#define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 1
#else
#define ABSL_INTERNAL_APPLE_CXX17_TYPES_UNAVAILABLE 0
diff --git a/absl/strings/escaping_test.cc b/absl/strings/escaping_test.cc
index 6a633cdc..1967975b 100644
--- a/absl/strings/escaping_test.cc
+++ b/absl/strings/escaping_test.cc
@@ -72,6 +72,11 @@ TEST(CEscape, EscapeAndUnescape) {
EXPECT_TRUE(absl::CUnescape(escaped, &unescaped_str));
EXPECT_EQ(unescaped_str, original);
+ unescaped_str.erase();
+ std::string error;
+ EXPECT_TRUE(absl::CUnescape(escaped, &unescaped_str, &error));
+ EXPECT_EQ(error, "");
+
// Check in-place unescaping
std::string s = escaped;
EXPECT_TRUE(absl::CUnescape(s, &s));
@@ -150,7 +155,8 @@ TEST(CEscape, BasicEscaping) {
TEST(Unescape, BasicFunction) {
epair tests[] =
- {{"\\u0030", "0"},
+ {{"", ""},
+ {"\\u0030", "0"},
{"\\u00A3", "\xC2\xA3"},
{"\\u22FD", "\xE2\x8B\xBD"},
{"\\U00010000", "\xF0\x90\x80\x80"},
@@ -173,6 +179,9 @@ TEST(Unescape, BasicFunction) {
std::string out;
EXPECT_FALSE(absl::CUnescape(e, &out, &error));
EXPECT_FALSE(error.empty());
+
+ out.erase();
+ EXPECT_FALSE(absl::CUnescape(e, &out));
}
}