aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/cpp/cpp_helpers.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_helpers.cc')
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_helpers.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_helpers.cc b/src/google/protobuf/compiler/cpp/cpp_helpers.cc
index 28c4dd54..e293b413 100644
--- a/src/google/protobuf/compiler/cpp/cpp_helpers.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_helpers.cc
@@ -361,18 +361,26 @@ string FilenameIdentifier(const string& filename) {
}
// Return the name of the AddDescriptors() function for a given file.
-string GlobalAddDescriptorsName(const string& filename) {
- return "protobuf_AddDesc_" + FilenameIdentifier(filename);
+string GlobalAddDescriptorsName(const string& filename)
+{
+ return GlobalSymbolName(filename,"protobuf_AddDesc_");
}
// Return the name of the AssignDescriptors() function for a given file.
-string GlobalAssignDescriptorsName(const string& filename) {
- return "protobuf_AssignDesc_" + FilenameIdentifier(filename);
+string GlobalAssignDescriptorsName(const string& filename)
+{
+ return GlobalSymbolName(filename,"protobuf_AssignDesc_");
}
// Return the name of the ShutdownFile() function for a given file.
-string GlobalShutdownFileName(const string& filename) {
- return "protobuf_ShutdownFile_" + FilenameIdentifier(filename);
+string GlobalShutdownFileName(const string& filename)
+{
+ return GlobalSymbolName(filename,"protobuf_ShutdownFile_");
+}
+
+string GlobalSymbolName(const string& filename, string prefix)
+{
+ return prefix + FilenameIdentifier(filename);
}
// Return the qualified C++ name for a file level symbol.