diff options
author | liujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2011-02-07 19:03:53 +0000 |
---|---|---|
committer | liujisi@google.com <liujisi@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2011-02-07 19:03:53 +0000 |
commit | 17d57dbbcd01b90c536f7ee39415a864e26869d2 (patch) | |
tree | fc79fa6e0db655619f151c216ab6c4127a5c3964 /src | |
parent | c345db7d6b3da29c36ad0492ef68cc471fac86db (diff) | |
download | protobuf-17d57dbbcd01b90c536f7ee39415a864e26869d2.tar.gz protobuf-17d57dbbcd01b90c536f7ee39415a864e26869d2.tar.bz2 protobuf-17d57dbbcd01b90c536f7ee39415a864e26869d2.zip |
Add an intermediate method to propagate the friendship access to nested classes as a workaround for old compilers (e.g. gcc 3.4)
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/descriptor.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 76b7219f..754b5628 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -2160,6 +2160,11 @@ class DescriptorBuilder { static inline bool get_is_placeholder(const Descriptor* descriptor) { return descriptor->is_placeholder_; } + static inline void assert_mutex_held(const DescriptorPool* pool) { + if (pool->mutex_ != NULL) { + pool->mutex_->AssertHeld(); + } + } // Must be run only after options have been interpreted. // @@ -4338,9 +4343,7 @@ class DescriptorBuilder::OptionInterpreter::AggregateOptionFinder virtual const FieldDescriptor* FindExtension( Message* message, const string& name) const { - if (builder_->pool_->mutex_ != NULL) { - builder_->pool_->mutex_->AssertHeld(); - } + assert_mutex_held(builder_->pool_); Symbol result = builder_->LookupSymbolNoPlaceholder( name, message->GetDescriptor()->full_name()); if (result.type == Symbol::FIELD && |