Skip to content

Commit 140793c

Browse files
authored
Import abseil-cpp source tag 20240116.1 (firebase#22)
* Import abseil-cpp source tag 20240116.1 * Fix nested redundant include for int128.h
1 parent 421664c commit 140793c

File tree

281 files changed

+8887
-9916
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

281 files changed

+8887
-9916
lines changed

Diff for: CMake/AbseilDll.cmake

+33-18
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ set(ABSL_INTERNAL_DLL_FILES
2828
"base/internal/low_level_scheduling.h"
2929
"base/internal/nullability_impl.h"
3030
"base/internal/per_thread_tls.h"
31-
"base/internal/prefetch.h"
3231
"base/prefetch.h"
3332
"base/internal/pretty_function.h"
3433
"base/internal/raw_logging.cc"
@@ -44,7 +43,6 @@ set(ABSL_INTERNAL_DLL_FILES
4443
"base/internal/spinlock_wait.h"
4544
"base/internal/sysinfo.cc"
4645
"base/internal/sysinfo.h"
47-
"base/internal/thread_annotations.h"
4846
"base/internal/thread_identity.cc"
4947
"base/internal/thread_identity.h"
5048
"base/internal/throw_delegate.cc"
@@ -57,6 +55,7 @@ set(ABSL_INTERNAL_DLL_FILES
5755
"base/log_severity.cc"
5856
"base/log_severity.h"
5957
"base/macros.h"
58+
"base/no_destructor.h"
6059
"base/nullability.h"
6160
"base/optimization.h"
6261
"base/options.h"
@@ -77,7 +76,6 @@ set(ABSL_INTERNAL_DLL_FILES
7776
"container/internal/common_policy_traits.h"
7877
"container/internal/compressed_tuple.h"
7978
"container/internal/container_memory.h"
80-
"container/internal/counting_allocator.h"
8179
"container/internal/hash_function_defaults.h"
8280
"container/internal/hash_policy_traits.h"
8381
"container/internal/hashtable_debug.h"
@@ -109,7 +107,7 @@ set(ABSL_INTERNAL_DLL_FILES
109107
"crc/internal/crc_x86_arm_combined.cc"
110108
"crc/internal/crc_memcpy_fallback.cc"
111109
"crc/internal/crc_memcpy.h"
112-
"crc/internal/crc_memcpy_x86_64.cc"
110+
"crc/internal/crc_memcpy_x86_arm_combined.cc"
113111
"crc/internal/crc_non_temporal_memcpy.cc"
114112
"crc/internal/crc_x86_arm_combined.cc"
115113
"crc/internal/non_temporal_arm_intrinsics.h"
@@ -141,6 +139,7 @@ set(ABSL_INTERNAL_DLL_FILES
141139
"functional/function_ref.h"
142140
"functional/internal/any_invocable.h"
143141
"functional/internal/function_ref.h"
142+
"functional/overload.h"
144143
"hash/hash.h"
145144
"hash/internal/city.h"
146145
"hash/internal/city.cc"
@@ -151,6 +150,7 @@ set(ABSL_INTERNAL_DLL_FILES
151150
"hash/internal/low_level_hash.cc"
152151
"log/absl_check.h"
153152
"log/absl_log.h"
153+
"log/absl_vlog_is_on.h"
154154
"log/check.h"
155155
"log/die_if_null.cc"
156156
"log/die_if_null.h"
@@ -163,6 +163,8 @@ set(ABSL_INTERNAL_DLL_FILES
163163
"log/internal/conditions.cc"
164164
"log/internal/conditions.h"
165165
"log/internal/config.h"
166+
"log/internal/fnmatch.h"
167+
"log/internal/fnmatch.cc"
166168
"log/internal/globals.cc"
167169
"log/internal/globals.h"
168170
"log/internal/log_format.cc"
@@ -179,6 +181,8 @@ set(ABSL_INTERNAL_DLL_FILES
179181
"log/internal/proto.cc"
180182
"log/internal/strip.h"
181183
"log/internal/structured.h"
184+
"log/internal/vlog_config.cc"
185+
"log/internal/vlog_config.h"
182186
"log/internal/voidify.h"
183187
"log/initialize.cc"
184188
"log/initialize.h"
@@ -190,6 +194,7 @@ set(ABSL_INTERNAL_DLL_FILES
190194
"log/log_sink_registry.h"
191195
"log/log_streamer.h"
192196
"log/structured.h"
197+
"log/vlog_is_on.h"
193198
"memory/memory.h"
194199
"meta/type_traits.h"
195200
"numeric/bits.h"
@@ -250,6 +255,7 @@ set(ABSL_INTERNAL_DLL_FILES
250255
"random/uniform_real_distribution.h"
251256
"random/zipf_distribution.h"
252257
"status/internal/status_internal.h"
258+
"status/internal/status_internal.cc"
253259
"status/internal/statusor_internal.h"
254260
"status/status.h"
255261
"status/status.cc"
@@ -261,6 +267,7 @@ set(ABSL_INTERNAL_DLL_FILES
261267
"strings/ascii.h"
262268
"strings/charconv.cc"
263269
"strings/charconv.h"
270+
"strings/charset.h"
264271
"strings/cord.cc"
265272
"strings/cord.h"
266273
"strings/cord_analysis.cc"
@@ -287,9 +294,6 @@ set(ABSL_INTERNAL_DLL_FILES
287294
"strings/internal/cord_rep_consume.h"
288295
"strings/internal/cord_rep_consume.cc"
289296
"strings/internal/cord_rep_flat.h"
290-
"strings/internal/cord_rep_ring.cc"
291-
"strings/internal/cord_rep_ring.h"
292-
"strings/internal/cord_rep_ring_reader.h"
293297
"strings/internal/cordz_functions.cc"
294298
"strings/internal/cordz_functions.h"
295299
"strings/internal/cordz_handle.cc"
@@ -308,6 +312,8 @@ set(ABSL_INTERNAL_DLL_FILES
308312
"strings/internal/stringify_sink.h"
309313
"strings/internal/stringify_sink.cc"
310314
"strings/internal/has_absl_stringify.h"
315+
"strings/has_absl_stringify.h"
316+
"strings/has_ostream_operator.h"
311317
"strings/match.cc"
312318
"strings/match.h"
313319
"strings/numbers.cc"
@@ -325,7 +331,6 @@ set(ABSL_INTERNAL_DLL_FILES
325331
"strings/strip.h"
326332
"strings/substitute.cc"
327333
"strings/substitute.h"
328-
"strings/internal/char_map.h"
329334
"strings/internal/escaping.h"
330335
"strings/internal/escaping.cc"
331336
"strings/internal/memutil.cc"
@@ -421,11 +426,6 @@ set(ABSL_INTERNAL_DLL_FILES
421426
"types/bad_variant_access.cc"
422427
"types/bad_variant_access.h"
423428
"types/compare.h"
424-
"types/internal/conformance_aliases.h"
425-
"types/internal/conformance_archetype.h"
426-
"types/internal/conformance_profile.h"
427-
"types/internal/parentheses.h"
428-
"types/internal/transform_args.h"
429429
"types/internal/variant.h"
430430
"types/optional.h"
431431
"types/internal/optional.h"
@@ -627,17 +627,32 @@ include(CheckCXXSourceCompiles)
627627
check_cxx_source_compiles(
628628
[==[
629629
#ifdef _MSC_VER
630-
# if _MSVC_LANG < 201700L
630+
# if _MSVC_LANG < 201703L
631631
# error "The compiler defaults or is configured for C++ < 17"
632632
# endif
633-
#elif __cplusplus < 201700L
633+
#elif __cplusplus < 201703L
634634
# error "The compiler defaults or is configured for C++ < 17"
635635
#endif
636636
int main() { return 0; }
637637
]==]
638638
ABSL_INTERNAL_AT_LEAST_CXX17)
639639

640-
if(ABSL_INTERNAL_AT_LEAST_CXX17)
640+
check_cxx_source_compiles(
641+
[==[
642+
#ifdef _MSC_VER
643+
# if _MSVC_LANG < 202002L
644+
# error "The compiler defaults or is configured for C++ < 20"
645+
# endif
646+
#elif __cplusplus < 202002L
647+
# error "The compiler defaults or is configured for C++ < 20"
648+
#endif
649+
int main() { return 0; }
650+
]==]
651+
ABSL_INTERNAL_AT_LEAST_CXX20)
652+
653+
if(ABSL_INTERNAL_AT_LEAST_CXX20)
654+
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_20)
655+
elseif(ABSL_INTERNAL_AT_LEAST_CXX17)
641656
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_17)
642657
else()
643658
set(ABSL_INTERNAL_CXX_STD_FEATURE cxx_std_14)
@@ -807,8 +822,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
807822

808823
if(ABSL_PROPAGATE_CXX_STD)
809824
# Abseil libraries require C++14 as the current minimum standard. When
810-
# compiled with C++17 (either because it is the compiler's default or
811-
# explicitly requested), then Abseil requires C++17.
825+
# compiled with a higher minimum (either because it is the compiler's
826+
# default or explicitly requested), then Abseil requires that standard.
812827
target_compile_features(${_dll} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
813828
endif()
814829

Diff for: CMake/AbseilHelpers.cmake

+4-4
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ endif()
8080
# absl::fantastic_lib
8181
# )
8282
#
83-
# TODO: Implement "ALWAYSLINK"
83+
# TODO(b/320467376): Implement "ALWAYSLINK".
8484
function(absl_cc_library)
8585
cmake_parse_arguments(ABSL_CC_LIB
8686
"DISABLE_INSTALL;PUBLIC;TESTONLY"
@@ -287,8 +287,8 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
287287

288288
if(ABSL_PROPAGATE_CXX_STD)
289289
# Abseil libraries require C++14 as the current minimum standard. When
290-
# compiled with C++17 (either because it is the compiler's default or
291-
# explicitly requested), then Abseil requires C++17.
290+
# compiled with a higher standard (either because it is the compiler's
291+
# default or explicitly requested), then Abseil requires that standard.
292292
target_compile_features(${_NAME} PUBLIC ${ABSL_INTERNAL_CXX_STD_FEATURE})
293293
endif()
294294

@@ -298,7 +298,7 @@ Cflags: -I\${includedir}${PC_CFLAGS}\n")
298298
if(ABSL_ENABLE_INSTALL)
299299
set_target_properties(${_NAME} PROPERTIES
300300
OUTPUT_NAME "absl_${_NAME}"
301-
SOVERSION "2308.0.0"
301+
SOVERSION "2401.0.0"
302302
)
303303
endif()
304304
else()

Diff for: CMakeLists.txt

+35-9
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ if (POLICY CMP0048)
3333
cmake_policy(SET CMP0048 NEW)
3434
endif (POLICY CMP0048)
3535

36+
# Honor the GTest_ROOT variable if specified
37+
if (POLICY CMP0074)
38+
cmake_policy(SET CMP0074 NEW)
39+
endif (POLICY CMP0074)
40+
3641
# option() honor variables
3742
if (POLICY CMP0077)
3843
cmake_policy(SET CMP0077 NEW)
@@ -53,7 +58,7 @@ if (POLICY CMP0141)
5358
cmake_policy(SET CMP0141 NEW)
5459
endif (POLICY CMP0141)
5560

56-
project(absl LANGUAGES CXX VERSION 20230802)
61+
project(absl LANGUAGES CXX VERSION 20240116)
5762
include(CTest)
5863

5964
# Output directory is correct by default for most build setups. However, when
@@ -221,20 +226,41 @@ if(ABSL_ENABLE_INSTALL)
221226
PATTERN "testdata" EXCLUDE
222227
)
223228

229+
# Rewrite options.h to use the compiled ABI.
224230
file(READ "absl/base/options.h" ABSL_INTERNAL_OPTIONS_H_CONTENTS)
225-
if (ABSL_INTERNAL_AT_LEAST_CXX17)
226-
string(REGEX REPLACE
227-
"#define ABSL_OPTION_USE_STD_([^ ]*) 2"
228-
"#define ABSL_OPTION_USE_STD_\\1 1"
231+
232+
# Handle features that require at least C++20.
233+
if (ABSL_INTERNAL_AT_LEAST_CXX20)
234+
foreach(FEATURE "ORDERING")
235+
string(REPLACE
236+
"#define ABSL_OPTION_USE_STD_${FEATURE} 2"
237+
"#define ABSL_OPTION_USE_STD_${FEATURE} 1"
229238
ABSL_INTERNAL_OPTIONS_H_PINNED
230239
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")
231-
else()
232-
string(REGEX REPLACE
233-
"#define ABSL_OPTION_USE_STD_([^ ]*) 2"
234-
"#define ABSL_OPTION_USE_STD_\\1 0"
240+
set(ABSL_INTERNAL_OPTIONS_H_CONTENTS "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
241+
endforeach()
242+
endif()
243+
244+
# Handle features that require at least C++17.
245+
if (ABSL_INTERNAL_AT_LEAST_CXX17)
246+
foreach(FEATURE "ANY" "OPTIONAL" "STRING_VIEW" "VARIANT")
247+
string(REPLACE
248+
"#define ABSL_OPTION_USE_STD_${FEATURE} 2"
249+
"#define ABSL_OPTION_USE_STD_${FEATURE} 1"
235250
ABSL_INTERNAL_OPTIONS_H_PINNED
236251
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")
252+
set(ABSL_INTERNAL_OPTIONS_H_CONTENTS "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
253+
endforeach()
237254
endif()
255+
256+
# Any feature that still has the value of 2 (because it was not handled above)
257+
# should be set to 0.
258+
string(REGEX REPLACE
259+
"#define ABSL_OPTION_USE_STD_([^ ]*) 2"
260+
"#define ABSL_OPTION_USE_STD_\\1 0"
261+
ABSL_INTERNAL_OPTIONS_H_PINNED
262+
"${ABSL_INTERNAL_OPTIONS_H_CONTENTS}")
263+
238264
file(WRITE "${CMAKE_BINARY_DIR}/options-pinned.h" "${ABSL_INTERNAL_OPTIONS_H_PINNED}")
239265

240266
install(FILES "${CMAKE_BINARY_DIR}/options-pinned.h"

Diff for: MODULE.bazel

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright 2024 The Abseil Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# https://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# https://bazel.build/external/overview#bzlmod
16+
17+
module(
18+
name = "abseil-cpp",
19+
version = "20240116.0",
20+
compatibility_level = 1,
21+
)
22+
23+
# Only direct dependencies need to be listed below.
24+
# Please keep the versions in sync with the versions in the WORKSPACE file.
25+
26+
bazel_dep(name = "bazel_skylib",
27+
version = "1.5.0")
28+
29+
bazel_dep(name = "google_benchmark",
30+
version = "1.8.3",
31+
repo_name = "com_github_google_benchmark",
32+
dev_dependency = True)
33+
34+
bazel_dep(name = "googletest",
35+
version = "1.14.0.bcr.1",
36+
repo_name = "com_google_googletest")
37+
38+
bazel_dep(name = "platforms",
39+
version = "0.0.8")

Diff for: PrivacyInfo.xcprivacy

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5-
<key>NSPrivacyTracking</key>
6-
<false/>
7-
<key>NSPrivacyCollectedDataTypes</key>
8-
<array/>
9-
<key>NSPrivacyTrackingDomains</key>
10-
<array/>
11-
<key>NSPrivacyAccessedAPITypes</key>
12-
<array/>
5+
<key>NSPrivacyTracking</key>
6+
<false/>
7+
<key>NSPrivacyCollectedDataTypes</key>
8+
<array/>
9+
<key>NSPrivacyTrackingDomains</key>
10+
<array/>
11+
<key>NSPrivacyAccessedAPITypes</key>
12+
<array/>
1313
</dict>
1414
</plist>

Diff for: README.md

-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
# Swift Package Manager copy repository
2-
3-
This repository is a copy of https://github.com/firebase/abseil-cpp with
4-
the git metadata removed to provide one to two orders of magnitude increase in
5-
speed for Swift Package Manager usage.
6-
7-
This repo is not supported as a direct dependency for non-Google usage.
8-
9-
There should be no changes to this repo other than updates from its mirror
10-
and Swift Package Manager specific items.
11-
121
# Abseil - C++ Common Libraries
132

143
The repository contains the Abseil C++ library code. Abseil is an open-source

0 commit comments

Comments
 (0)