aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrad Larson <bklarson@gmail.com>2017-07-24 16:52:04 -0500
committerBrad Larson <bklarson@gmail.com>2017-07-24 16:52:04 -0500
commitb6da2262e811d5c8d4b65d62756e9901a8dff48d (patch)
tree7d3ed55844b54f17bbfe577fd04cc2e59f38aa3f /src
parent0d9a34c7b2c66ba324cdbe620a6013b037be3b5d (diff)
downloadprotobuf-b6da2262e811d5c8d4b65d62756e9901a8dff48d.tar.gz
protobuf-b6da2262e811d5c8d4b65d62756e9901a8dff48d.tar.bz2
protobuf-b6da2262e811d5c8d4b65d62756e9901a8dff48d.zip
Put AddDescriptorsImpl() in anonymous namespace
AddDescriptorsImpl() is a private static implementation detail, and needs to be declared but won't be used from outside the source file. Place it inside an anonymous namespace to fix a previous build error that would result in more restrictive build enviornments that use -Werror=missing-declarations or similar compiler flags.
Diffstat (limited to 'src')
-rw-r--r--src/google/protobuf/any.pb.cc2
-rw-r--r--src/google/protobuf/api.pb.cc2
-rw-r--r--src/google/protobuf/compiler/cpp/cpp_file.cc2
-rw-r--r--src/google/protobuf/compiler/plugin.pb.cc2
-rw-r--r--src/google/protobuf/compiler/profile.pb.cc2
-rw-r--r--src/google/protobuf/descriptor.pb.cc2
-rw-r--r--src/google/protobuf/duration.pb.cc2
-rw-r--r--src/google/protobuf/empty.pb.cc2
-rw-r--r--src/google/protobuf/field_mask.pb.cc2
-rw-r--r--src/google/protobuf/source_context.pb.cc2
-rw-r--r--src/google/protobuf/struct.pb.cc2
-rw-r--r--src/google/protobuf/timestamp.pb.cc2
-rw-r--r--src/google/protobuf/type.pb.cc2
-rw-r--r--src/google/protobuf/wrappers.pb.cc2
14 files changed, 28 insertions, 0 deletions
diff --git a/src/google/protobuf/any.pb.cc b/src/google/protobuf/any.pb.cc
index e36ffb5f..948530ba 100644
--- a/src/google/protobuf/any.pb.cc
+++ b/src/google/protobuf/any.pb.cc
@@ -102,6 +102,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -118,6 +119,7 @@ void AddDescriptorsImpl() {
"google/protobuf/any.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/api.pb.cc b/src/google/protobuf/api.pb.cc
index 766c7e0d..093bf1cb 100644
--- a/src/google/protobuf/api.pb.cc
+++ b/src/google/protobuf/api.pb.cc
@@ -146,6 +146,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -177,6 +178,7 @@ void AddDescriptorsImpl() {
::google::protobuf::protobuf_google_2fprotobuf_2ftype_2eproto::AddDescriptors();
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/compiler/cpp/cpp_file.cc b/src/google/protobuf/compiler/cpp/cpp_file.cc
index d79a3e73..feb8ba65 100644
--- a/src/google/protobuf/compiler/cpp/cpp_file.cc
+++ b/src/google/protobuf/compiler/cpp/cpp_file.cc
@@ -811,6 +811,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
// Now generate the AddDescriptors() function.
printer->Print(
+ "namespace {\n"
"void AddDescriptorsImpl() {\n"
" InitDefaults();\n");
@@ -882,6 +883,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
printer->Outdent();
printer->Print(
"}\n"
+ "} // anonymous namespace\n"
"\n"
"void AddDescriptors() {\n"
" static GOOGLE_PROTOBUF_DECLARE_ONCE(once);\n"
diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc
index 3842ef61..516a5878 100644
--- a/src/google/protobuf/compiler/plugin.pb.cc
+++ b/src/google/protobuf/compiler/plugin.pb.cc
@@ -169,6 +169,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -196,6 +197,7 @@ void AddDescriptorsImpl() {
::google::protobuf::protobuf_google_2fprotobuf_2fdescriptor_2eproto::AddDescriptors();
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/compiler/profile.pb.cc b/src/google/protobuf/compiler/profile.pb.cc
index bf69f79d..4616b514 100644
--- a/src/google/protobuf/compiler/profile.pb.cc
+++ b/src/google/protobuf/compiler/profile.pb.cc
@@ -143,6 +143,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -162,6 +163,7 @@ void AddDescriptorsImpl() {
"google/protobuf/compiler/profile.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/descriptor.pb.cc b/src/google/protobuf/descriptor.pb.cc
index 04c6b8e1..78935211 100644
--- a/src/google/protobuf/descriptor.pb.cc
+++ b/src/google/protobuf/descriptor.pb.cc
@@ -663,6 +663,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -815,6 +816,7 @@ void AddDescriptorsImpl() {
"google/protobuf/descriptor.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/duration.pb.cc b/src/google/protobuf/duration.pb.cc
index 3892b197..e3c522f5 100644
--- a/src/google/protobuf/duration.pb.cc
+++ b/src/google/protobuf/duration.pb.cc
@@ -102,6 +102,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -118,6 +119,7 @@ void AddDescriptorsImpl() {
"google/protobuf/duration.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/empty.pb.cc b/src/google/protobuf/empty.pb.cc
index 86a77b61..9ff146f0 100644
--- a/src/google/protobuf/empty.pb.cc
+++ b/src/google/protobuf/empty.pb.cc
@@ -100,6 +100,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -115,6 +116,7 @@ void AddDescriptorsImpl() {
"google/protobuf/empty.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc
index faba7a02..5b29d247 100644
--- a/src/google/protobuf/field_mask.pb.cc
+++ b/src/google/protobuf/field_mask.pb.cc
@@ -101,6 +101,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -117,6 +118,7 @@ void AddDescriptorsImpl() {
"google/protobuf/field_mask.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/source_context.pb.cc b/src/google/protobuf/source_context.pb.cc
index d0c58825..9d394f70 100644
--- a/src/google/protobuf/source_context.pb.cc
+++ b/src/google/protobuf/source_context.pb.cc
@@ -101,6 +101,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -118,6 +119,7 @@ void AddDescriptorsImpl() {
"google/protobuf/source_context.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/struct.pb.cc b/src/google/protobuf/struct.pb.cc
index 28cfd3bd..a7ce0040 100644
--- a/src/google/protobuf/struct.pb.cc
+++ b/src/google/protobuf/struct.pb.cc
@@ -161,6 +161,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -188,6 +189,7 @@ void AddDescriptorsImpl() {
"google/protobuf/struct.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/timestamp.pb.cc b/src/google/protobuf/timestamp.pb.cc
index a8c3a1b4..7c9d396e 100644
--- a/src/google/protobuf/timestamp.pb.cc
+++ b/src/google/protobuf/timestamp.pb.cc
@@ -102,6 +102,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -118,6 +119,7 @@ void AddDescriptorsImpl() {
"google/protobuf/timestamp.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc
index f07bb0c6..fe422087 100644
--- a/src/google/protobuf/type.pb.cc
+++ b/src/google/protobuf/type.pb.cc
@@ -187,6 +187,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -239,6 +240,7 @@ void AddDescriptorsImpl() {
::google::protobuf::protobuf_google_2fprotobuf_2fsource_5fcontext_2eproto::AddDescriptors();
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
diff --git a/src/google/protobuf/wrappers.pb.cc b/src/google/protobuf/wrappers.pb.cc
index 9cd95c41..8b8dc150 100644
--- a/src/google/protobuf/wrappers.pb.cc
+++ b/src/google/protobuf/wrappers.pb.cc
@@ -213,6 +213,7 @@ void InitDefaults() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);
::google::protobuf::GoogleOnceInit(&once, &TableStruct::InitDefaultsImpl);
}
+namespace {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] = {
@@ -235,6 +236,7 @@ void AddDescriptorsImpl() {
"google/protobuf/wrappers.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::OnShutdown(&TableStruct::Shutdown);
}
+} // anonymous namespace
void AddDescriptors() {
static GOOGLE_PROTOBUF_DECLARE_ONCE(once);