blob: 126b79261cd112f4f8e91016a4fa5c2c7adf91aa [file] [log] [blame]
Andrew Geissler69721092021-07-23 12:57:00 -04001From c9250af98f48e4aa734cab0e2f5ae1f780c05ad0 Mon Sep 17 00:00:00 2001
2From: Zang Ruochen <zangrc.fnst@fujitsu.com>
3Date: Fri, 11 Jun 2021 10:53:37 +0900
William A. Kennington IIIb95905d2021-06-02 12:40:56 -07004Subject: [PATCH] Export of internal Abseil changes
5
6--
7cf88f9cf40eab54c06bca7f20795352ec23bb583 by Derek Mauro <dmauro@google.com>:
8
9Fixes build with latest glibc
10Fixes #952
11
12PiperOrigin-RevId: 371693908
13
14--
1599bcd0f4a747ce7a401e23c745adf34d0ec5131b by Samuel Benzaquen <sbenza@google.com>:
16
17Add support for std::string_view in StrFormat even when
18absl::string_view != std::string_view.
19
20PiperOrigin-RevId: 371693633
21
22--
23e35463572149a6c2d4a0d439b9300ce03fd6b96d by Abseil Team <absl-team@google.com>:
24
25Cmake builds should only install pkg-config when explicitly requested.
26
27PiperOrigin-RevId: 371403419
28GitOrigin-RevId: cf88f9cf40eab54c06bca7f20795352ec23bb583
29Change-Id: I4360a18c638a4d901ff44ab1e0a9d8f321c302ea
Andrew Geissler69721092021-07-23 12:57:00 -040030
31Signed-off-by: Zang Ruochen <zangrc.fnst@fujitsu.com>
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070032---
33 CMake/AbseilHelpers.cmake | 3 ++-
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070034 absl/strings/internal/str_format/arg.h | 8 ++++++++
35 absl/strings/internal/str_format/convert_test.cc | 3 +++
Andrew Geissler69721092021-07-23 12:57:00 -040036 3 files changed, 13 insertions(+), 1 deletion(-)
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070037
38diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
Andrew Geissler69721092021-07-23 12:57:00 -040039index 54fb8df3..a32b94d5 100644
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070040--- a/CMake/AbseilHelpers.cmake
41+++ b/CMake/AbseilHelpers.cmake
42@@ -141,7 +141,8 @@ function(absl_cc_library)
43 endif()
44
45 # Generate a pkg-config file for every library:
46- if(_build_type STREQUAL "static" OR _build_type STREQUAL "shared")
47+ if((_build_type STREQUAL "static" OR _build_type STREQUAL "shared")
48+ AND ABSL_ENABLE_INSTALL)
49 if(NOT ABSL_CC_LIB_TESTONLY)
50 if(absl_VERSION)
51 set(PC_VERSION "${absl_VERSION}")
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070052diff --git a/absl/strings/internal/str_format/arg.h b/absl/strings/internal/str_format/arg.h
53index 7040c866..3c91be70 100644
54--- a/absl/strings/internal/str_format/arg.h
55+++ b/absl/strings/internal/str_format/arg.h
56@@ -122,6 +122,14 @@ StringConvertResult FormatConvertImpl(const std::string& v,
57 StringConvertResult FormatConvertImpl(string_view v,
58 FormatConversionSpecImpl conv,
59 FormatSinkImpl* sink);
60+#if defined(ABSL_HAVE_STD_STRING_VIEW) && !defined(ABSL_USES_STD_STRING_VIEW)
61+inline StringConvertResult FormatConvertImpl(std::string_view v,
62+ FormatConversionSpecImpl conv,
63+ FormatSinkImpl* sink) {
64+ return FormatConvertImpl(absl::string_view(v.data(), v.size()), conv, sink);
65+}
66+#endif // ABSL_HAVE_STD_STRING_VIEW && !ABSL_USES_STD_STRING_VIEW
67+
68 ArgConvertResult<FormatConversionCharSetUnion(
69 FormatConversionCharSetInternal::s, FormatConversionCharSetInternal::p)>
70 FormatConvertImpl(const char* v, const FormatConversionSpecImpl conv,
71diff --git a/absl/strings/internal/str_format/convert_test.cc b/absl/strings/internal/str_format/convert_test.cc
72index 926283cf..91e03609 100644
73--- a/absl/strings/internal/str_format/convert_test.cc
74+++ b/absl/strings/internal/str_format/convert_test.cc
75@@ -229,6 +229,9 @@ TEST_F(FormatConvertTest, BasicString) {
76 TestStringConvert(static_cast<const char*>("hello"));
77 TestStringConvert(std::string("hello"));
78 TestStringConvert(string_view("hello"));
79+#if defined(ABSL_HAVE_STD_STRING_VIEW)
80+ TestStringConvert(std::string_view("hello"));
81+#endif // ABSL_HAVE_STD_STRING_VIEW
82 }
83
84 TEST_F(FormatConvertTest, NullString) {
85--
Andrew Geissler69721092021-07-23 12:57:00 -0400862.25.1
William A. Kennington IIIb95905d2021-06-02 12:40:56 -070087