Skip to content

Commit bc257a8

Browse files
authored
Apply LTS transformations for 20250512 LTS branch (#1886)
* Apply LTS transformations for 20250512 LTS branch * Cherry-pick google/cctz@306fd9b
1 parent 9a89ea8 commit bc257a8

File tree

5 files changed

+19
-27
lines changed

5 files changed

+19
-27
lines changed

CMakeLists.txt

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ if (POLICY CMP0141)
2323
cmake_policy(SET CMP0141 NEW)
2424
endif (POLICY CMP0141)
2525

26-
project(absl LANGUAGES CXX)
27-
set(ABSL_SOVERSION 0)
26+
project(absl LANGUAGES CXX VERSION 20250512)
27+
set(ABSL_SOVERSION "2505.0.0")
2828
include(CTest)
2929

3030
# Output directory is correct by default for most build setups. However, when
@@ -170,17 +170,7 @@ endif()
170170
add_subdirectory(absl)
171171

172172
if(ABSL_ENABLE_INSTALL)
173-
# absl:lts-remove-begin(system installation is supported for LTS releases)
174-
# We don't support system-wide installation
175-
list(APPEND SYSTEM_INSTALL_DIRS "/usr/local" "/usr" "/opt/" "/opt/local" "c:/Program Files/${PROJECT_NAME}")
176-
if(NOT DEFINED CMAKE_INSTALL_PREFIX OR CMAKE_INSTALL_PREFIX IN_LIST SYSTEM_INSTALL_DIRS)
177-
message(WARNING "\
178-
The default and system-level install directories are unsupported except in LTS \
179-
releases of Abseil. Please set CMAKE_INSTALL_PREFIX to install Abseil in your \
180-
source or build tree directly.\
181-
")
182-
endif()
183-
# absl:lts-remove-end
173+
184174

185175
# install as a subdirectory only
186176
install(EXPORT ${PROJECT_NAME}Targets

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
module(
1818
name = "abseil-cpp",
19-
version = "head",
19+
version = "20250512.0",
2020
compatibility_level = 1,
2121
)
2222

absl/base/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@
117117
//
118118
// LTS releases can be obtained from
119119
// https://github.com/abseil/abseil-cpp/releases.
120-
#undef ABSL_LTS_RELEASE_VERSION
121-
#undef ABSL_LTS_RELEASE_PATCH_LEVEL
120+
#define ABSL_LTS_RELEASE_VERSION 20250512
121+
#define ABSL_LTS_RELEASE_PATCH_LEVEL 0
122122

123123
// Helper macro to convert a CPP variable to a string literal.
124124
#define ABSL_INTERNAL_DO_TOKEN_STR(x) #x

absl/base/options.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@
148148
// be changed to a new, unique identifier name. In particular "head" is not
149149
// allowed.
150150

151-
#define ABSL_OPTION_USE_INLINE_NAMESPACE 0
152-
#define ABSL_OPTION_INLINE_NAMESPACE_NAME head
151+
#define ABSL_OPTION_USE_INLINE_NAMESPACE 1
152+
#define ABSL_OPTION_INLINE_NAMESPACE_NAME lts_20250512
153153

154154
// ABSL_OPTION_HARDENED
155155
//

absl/time/internal/cctz/src/time_zone_lookup.cc

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
#endif // __has_include
5858
#endif // _WIN32
5959

60+
#include <array>
61+
#include <cstdint>
6062
#include <cstdlib>
6163
#include <cstring>
6264
#include <string>
@@ -121,25 +123,25 @@ std::string win32_local_time_zone() {
121123
return "";
122124
}
123125

124-
UChar buffer[128];
126+
std::array<UChar, 128> buffer;
125127
UErrorCode status = U_ZERO_ERROR;
126128
const auto num_chars_in_buffer = ucal_getTimeZoneIDForWindowsIDFunc(
127-
reinterpret_cast<const UChar*>(info.TimeZoneKeyName), -1, nullptr, buffer,
128-
ARRAYSIZE(buffer), &status);
129+
reinterpret_cast<const UChar*>(info.TimeZoneKeyName), -1, nullptr,
130+
buffer.data(), static_cast<int32_t>(buffer.size()), &status);
129131
if (status != U_ZERO_ERROR || num_chars_in_buffer <= 0 ||
130-
num_chars_in_buffer > ARRAYSIZE(buffer)) {
132+
num_chars_in_buffer > static_cast<int32_t>(buffer.size())) {
131133
return "";
132134
}
133135

134136
const int num_bytes_in_utf8 = ::WideCharToMultiByte(
135-
CP_UTF8, 0, reinterpret_cast<const wchar_t*>(buffer),
137+
CP_UTF8, 0, reinterpret_cast<const wchar_t*>(buffer.data()),
136138
static_cast<int>(num_chars_in_buffer), nullptr, 0, nullptr, nullptr);
137139
std::string local_time_str;
138140
local_time_str.resize(static_cast<size_t>(num_bytes_in_utf8));
139-
::WideCharToMultiByte(CP_UTF8, 0, reinterpret_cast<const wchar_t*>(buffer),
140-
static_cast<int>(num_chars_in_buffer),
141-
&local_time_str[0], num_bytes_in_utf8, nullptr,
142-
nullptr);
141+
::WideCharToMultiByte(
142+
CP_UTF8, 0, reinterpret_cast<const wchar_t*>(buffer.data()),
143+
static_cast<int>(num_chars_in_buffer), &local_time_str[0],
144+
num_bytes_in_utf8, nullptr, nullptr);
143145
return local_time_str;
144146
}
145147
#endif // USE_WIN32_LOCAL_TIME_ZONE

0 commit comments

Comments
 (0)