Skip to content

Commit 1e1d882

Browse files
authored
Prepare cpp-protobuf migration (#8443)
Co-authored-by: Dmitry Nechitaev <nechda@yandex-team.ru>
1 parent acc9844 commit 1e1d882

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

ydb/library/yql/parser/proto_ast/gen/multiproto.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def main(argv):
7373
if type_name in current_types:
7474
out_file.write(line)
7575
continue
76-
if line.startswith("static ") or (line.startswith("const ") and ("[]" in line or "=" in line)) or line.startswith("PROTOBUF_ATTRIBUTE_WEAK"):
76+
if line.startswith("static ") or (line.startswith("const ") and ("[]" in line or "=" in line)) or line.startswith("PROTOBUF_ATTRIBUTE_WEAK") or line.startswith("PROTOBUF_ATTRIBUTE_INIT_PRIORITY2"):
7777
is_data_stmt = True
7878
extern_data = "file_level_metadata" in line or ("descriptor_table" in line and "once" in line)
7979
extern_code = line.startswith("PROTOBUF_ATTRIBUTE_WEAK")

ydb/public/lib/ydb_cli/commands/ydb_service_scheme.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <ydb/public/lib/ydb_cli/common/print_utils.h>
66
#include <ydb/public/lib/ydb_cli/common/scheme_printers.h>
77
#include <ydb/public/sdk/cpp/client/ydb_proto/accessor.h>
8+
#include <google/protobuf/port_def.inc>
89

910
#include <util/string/join.h>
1011

@@ -303,7 +304,11 @@ static int PrintProtoJsonBase64(const T& msg) {
303304
const auto status = MessageToJsonString(msg, &json, opts);
304305

305306
if (!status.ok()) {
307+
#if PROTOBUF_VERSION >= 4022005
308+
Cerr << "Error occurred while converting proto to json: " << status.message() << Endl;
309+
#else
306310
Cerr << "Error occurred while converting proto to json: " << status.message().ToString() << Endl;
311+
#endif
307312
return EXIT_FAILURE;
308313
}
309314

0 commit comments

Comments
 (0)