Skip to content

Commit e0238df

Browse files
jvolkmanejona86
authored andcommitted
Update to handle rename of java_names.h to names.h in protobuf upstream (#9218)
1 parent 6bf3e2c commit e0238df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

compiler/src/java_plugin/cpp/java_generator.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,18 @@
2222
#include <map>
2323
#include <set>
2424
#include <vector>
25-
#include <google/protobuf/compiler/java/java_names.h>
2625
#include <google/protobuf/descriptor.h>
2726
#include <google/protobuf/descriptor.pb.h>
2827
#include <google/protobuf/io/printer.h>
2928
#include <google/protobuf/io/zero_copy_stream.h>
29+
#include <google/protobuf/stubs/common.h>
30+
31+
// Protobuf 3.21 changed the name of this file.
32+
#if GOOGLE_PROTOBUF_VERSION >= 3021000
33+
#include <google/protobuf/compiler/java/names.h>
34+
#else
35+
#include <google/protobuf/compiler/java/java_names.h>
36+
#endif
3037

3138
// Stringify helpers used solely to cast GRPC_VERSION
3239
#ifndef STR

0 commit comments

Comments
 (0)