Skip to content

Commit 91d1bcb

Browse files
authored
Merge pull request #12622 from deannagarcia/22.x
fix(libprotoc): export useful symbols from .so
2 parents 238d250 + 860fbf1 commit 91d1bcb

File tree

2 files changed

+23
-22
lines changed

2 files changed

+23
-22
lines changed

src/google/protobuf/compiler/cpp/helpers.h

+9-9
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ std::string Namespace(const FileDescriptor* d, const Options& options);
119119
std::string Namespace(const Descriptor* d, const Options& options);
120120
std::string Namespace(const FieldDescriptor* d, const Options& options);
121121
std::string Namespace(const EnumDescriptor* d, const Options& options);
122-
std::string Namespace(const FileDescriptor* d);
123-
std::string Namespace(const Descriptor* d);
124-
std::string Namespace(const FieldDescriptor* d);
125-
std::string Namespace(const EnumDescriptor* d);
122+
PROTOC_EXPORT std::string Namespace(const FileDescriptor* d);
123+
PROTOC_EXPORT std::string Namespace(const Descriptor* d);
124+
PROTOC_EXPORT std::string Namespace(const FieldDescriptor* d);
125+
PROTOC_EXPORT std::string Namespace(const EnumDescriptor* d);
126126

127127
class MessageSCCAnalyzer;
128128

@@ -136,14 +136,14 @@ bool CanClearByZeroing(const FieldDescriptor* field);
136136
bool HasTrivialSwap(const FieldDescriptor* field, const Options& options,
137137
MessageSCCAnalyzer* scc_analyzer);
138138

139-
std::string ClassName(const Descriptor* descriptor);
140-
std::string ClassName(const EnumDescriptor* enum_descriptor);
139+
PROTOC_EXPORT std::string ClassName(const Descriptor* descriptor);
140+
PROTOC_EXPORT std::string ClassName(const EnumDescriptor* enum_descriptor);
141141

142142
std::string QualifiedClassName(const Descriptor* d, const Options& options);
143143
std::string QualifiedClassName(const EnumDescriptor* d, const Options& options);
144144

145-
std::string QualifiedClassName(const Descriptor* d);
146-
std::string QualifiedClassName(const EnumDescriptor* d);
145+
PROTOC_EXPORT std::string QualifiedClassName(const Descriptor* d);
146+
PROTOC_EXPORT std::string QualifiedClassName(const EnumDescriptor* d);
147147

148148
// DEPRECATED just use ClassName or QualifiedClassName, a boolean is very
149149
// unreadable at the callsite.
@@ -215,7 +215,7 @@ std::string ResolveKeyword(absl::string_view name);
215215
// The name is coerced to lower-case to emulate proto1 behavior. People
216216
// should be using lowercase-with-underscores style for proto field names
217217
// anyway, so normally this just returns field->name().
218-
std::string FieldName(const FieldDescriptor* field);
218+
PROTOC_EXPORT std::string FieldName(const FieldDescriptor* field);
219219

220220
// Returns the (unqualified) private member name for this field in C++ code.
221221
std::string FieldMemberName(const FieldDescriptor* field, bool split);

src/google/protobuf/compiler/cpp/names.h

+14-13
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ namespace cpp {
5757
// message Baz { message Moo {} }
5858
// Then the qualified namespace for Moo would be:
5959
// ::foo::bar
60-
std::string Namespace(const FileDescriptor* d);
61-
std::string Namespace(const Descriptor* d);
62-
std::string Namespace(const FieldDescriptor* d);
63-
std::string Namespace(const EnumDescriptor* d);
60+
PROTOC_EXPORT std::string Namespace(const FileDescriptor* d);
61+
PROTOC_EXPORT std::string Namespace(const Descriptor* d);
62+
PROTOC_EXPORT std::string Namespace(const FieldDescriptor* d);
63+
PROTOC_EXPORT std::string Namespace(const EnumDescriptor* d);
6464

6565
// Returns the unqualified C++ name.
6666
//
@@ -69,8 +69,8 @@ std::string Namespace(const EnumDescriptor* d);
6969
// message Baz { message Moo {} }
7070
// Then the non-qualified version would be:
7171
// Baz_Moo
72-
std::string ClassName(const Descriptor* descriptor);
73-
std::string ClassName(const EnumDescriptor* enum_descriptor);
72+
PROTOC_EXPORT std::string ClassName(const Descriptor* descriptor);
73+
PROTOC_EXPORT std::string ClassName(const EnumDescriptor* enum_descriptor);
7474

7575
// Returns the fully qualified C++ name.
7676
//
@@ -79,25 +79,26 @@ std::string ClassName(const EnumDescriptor* enum_descriptor);
7979
// message Baz { message Moo {} }
8080
// Then the qualified ClassName for Moo would be:
8181
// ::foo::bar::Baz_Moo
82-
std::string QualifiedClassName(const Descriptor* d);
83-
std::string QualifiedClassName(const EnumDescriptor* d);
84-
std::string QualifiedExtensionName(const FieldDescriptor* d);
82+
PROTOC_EXPORT std::string QualifiedClassName(const Descriptor* d);
83+
PROTOC_EXPORT std::string QualifiedClassName(const EnumDescriptor* d);
84+
PROTOC_EXPORT std::string QualifiedExtensionName(const FieldDescriptor* d);
8585

8686
// Get the (unqualified) name that should be used for this field in C++ code.
8787
// The name is coerced to lower-case to emulate proto1 behavior. People
8888
// should be using lowercase-with-underscores style for proto field names
8989
// anyway, so normally this just returns field->name().
90-
std::string FieldName(const FieldDescriptor* field);
90+
PROTOC_EXPORT std::string FieldName(const FieldDescriptor* field);
9191

9292
// Requires that this field is in a oneof. Returns the (unqualified) case
9393
// constant for this field.
94-
std::string OneofCaseConstantName(const FieldDescriptor* field);
94+
PROTOC_EXPORT std::string OneofCaseConstantName(const FieldDescriptor* field);
9595
// Returns the quafilied case constant for this field.
96-
std::string QualifiedOneofCaseConstantName(const FieldDescriptor* field);
96+
PROTOC_EXPORT std::string QualifiedOneofCaseConstantName(
97+
const FieldDescriptor* field);
9798

9899
// Get the (unqualified) name that should be used for this enum value in C++
99100
// code.
100-
std::string EnumValueName(const EnumValueDescriptor* enum_value);
101+
PROTOC_EXPORT std::string EnumValueName(const EnumValueDescriptor* enum_value);
101102

102103
// Strips ".proto" or ".protodevel" from the end of a filename.
103104
PROTOC_EXPORT std::string StripProto(absl::string_view filename);

0 commit comments

Comments
 (0)