Skip to content

Commit bb5cb4b

Browse files
committed
Prepare code to be ready for abseil-cpp > 20140116
Right now, we can't switch yet to be compatible with all bazel versions (unfortunately, newer abseil-cpp require bazel 7), but at least have the code ready in case someone compiles it in such environment.
1 parent f1f3f46 commit bb5cb4b

File tree

5 files changed

+22
-1
lines changed

5 files changed

+22
-1
lines changed

verible/common/formatting/layout-optimizer.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
#include "verible/common/util/tree-operations.h"
4141
#include "verible/common/util/value-saver.h"
4242

43+
#if ABSL_LTS_RELEASE_VERSION > 20240200
44+
#include "absl/log/vlog_is_on.h"
45+
#endif
46+
4347
namespace verible {
4448

4549
void OptimizeTokenPartitionTree(const BasicFormatStyle &style,

verible/common/lsp/lsp-file-utils.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ std::string DecodeURI(std::string_view uri) {
5656
pos++;
5757
if (pos + 2 <= uri.size() && std::isxdigit(uri[pos]) &&
5858
std::isxdigit(uri[pos + 1])) {
59-
std::string hex = absl::HexStringToBytes(uri.substr(pos, 2));
59+
std::string hex;
60+
#if ABSL_LTS_RELEASE_VERSION > 20240200
61+
if (!absl::HexStringToBytes(uri.substr(pos, 2), &hex)) break;
62+
#else
63+
hex = absl::HexStringToBytes(uri.substr(pos, 2));
64+
#endif
6065
absl::StrAppend(&result, hex.length() == 1 ? hex : uri.substr(pos, 2));
6166
pos += 2;
6267
} else {

verible/verilog/analysis/verilog-analyzer.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@
4848
#include "verible/verilog/parser/verilog-token-enum.h"
4949
#include "verible/verilog/preprocessor/verilog-preprocess.h"
5050

51+
#if ABSL_LTS_RELEASE_VERSION > 20240200
52+
#include "absl/log/vlog_is_on.h"
53+
#endif
54+
5155
namespace verilog {
5256

5357
using verible::TokenInfo;

verible/verilog/analysis/verilog-linter.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
#include "verible/verilog/parser/verilog-token-classifications.h"
5656
#include "verible/verilog/parser/verilog-token-enum.h"
5757

58+
#if ABSL_LTS_RELEASE_VERSION > 20240200
59+
#include "absl/log/vlog_is_on.h"
60+
#endif
61+
5862
// TODO(hzeller): make --rules repeatable and cumulative
5963

6064
ABSL_FLAG(verilog::RuleBundle, rules, {},

verible/verilog/tools/ls/symbol-table-handler.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@
4949
#include "verible/verilog/tools/ls/lsp-conversion.h"
5050
#include "verible/verilog/tools/ls/lsp-parse-buffer.h"
5151

52+
#if ABSL_LTS_RELEASE_VERSION > 20240200
53+
#include "absl/log/vlog_is_on.h"
54+
#endif
55+
5256
ABSL_FLAG(std::string, file_list_path, "verible.filelist",
5357
"Name of the file with Verible FileList for the project");
5458

0 commit comments

Comments
 (0)