Skip to content

Commit 4cddb19

Browse files
committed
Merge branch 'gz-msgs11' into merge_11_main_20250714
2 parents f1d2d8e + bd692ab commit 4cddb19

4 files changed

Lines changed: 14 additions & 12 deletions

File tree

.github/workflows/bazel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ concurrency:
1111

1212
jobs:
1313
test:
14-
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v7
14+
uses: bazel-contrib/.github/.github/workflows/bazel.yaml@v7.2.2
1515
with:
1616
folders: |
1717
[

BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ cc_binary(
5858
"core/generator_lite/Generator.hh",
5959
"core/generator_lite/generator_main.cc",
6060
],
61+
visibility = ["//:__subpackages__"],
6162
deps = [
6263
"@com_google_protobuf//:protobuf",
6364
"@com_google_protobuf//:protoc_lib",

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module(
55
)
66

77
bazel_dep(name = "googletest", version = "1.14.0")
8-
bazel_dep(name = "protobuf", version = "29.4", repo_name = "com_google_protobuf")
8+
bazel_dep(name = "protobuf", version = "30.1", repo_name = "com_google_protobuf")
99
bazel_dep(name = "rules_license", version = "1.0.0")
1010
bazel_dep(name = "rules_proto", version = "7.1.0")
1111
bazel_dep(name = "rules_python", version = "0.36.0")

core/generator_lite/Generator.cc

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ bool Generator::Generate(const FileDescriptor *_file,
6060
std::string * /*_error*/) const
6161
{
6262
std::string delim = ".proto";
63-
auto headerFilename = _file->name();
64-
auto sourceFilename = _file->name();
63+
std::string headerFilename(_file->name());
64+
std::string sourceFilename(_file->name());
6565

6666
{
6767
auto pos = headerFilename.rfind(delim);
@@ -87,26 +87,27 @@ bool Generator::Generate(const FileDescriptor *_file,
8787
{
8888
const auto *desc = _file->message_type(i);
8989
std::string ptrTypes;
90+
std::string descName(desc->name());
9091

9192
// Define std::unique_ptr types for our messages
9293
ptrTypes += "typedef std::unique_ptr<"
93-
+ desc->name() + "> "
94-
+ desc->name() + "UniquePtr;\n";
94+
+ descName + "> "
95+
+ descName + "UniquePtr;\n";
9596

9697
// Define const std::unique_ptr types for our messages
9798
ptrTypes += "typedef std::unique_ptr<const "
98-
+ desc->name() + "> Const"
99-
+ desc->name() + "UniquePtr;\n";
99+
+ descName + "> Const"
100+
+ descName + "UniquePtr;\n";
100101

101102
// Define std::shared_ptr types for our messages
102103
ptrTypes += "typedef std::shared_ptr<"
103-
+ desc->name() + "> "
104-
+ desc->name() + "SharedPtr;\n";
104+
+ descName + "> "
105+
+ descName + "SharedPtr;\n";
105106

106107
// Define const std::shared_ptr types for our messages
107108
ptrTypes += "typedef std::shared_ptr<const "
108-
+ desc->name() + "> Const"
109-
+ desc->name() + "SharedPtr;\n";
109+
+ descName + "> Const"
110+
+ descName + "SharedPtr;\n";
110111

111112
printer.PrintRaw(ptrTypes.c_str());
112113
}

0 commit comments

Comments
 (0)