aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/extension_set.h
diff options
context:
space:
mode:
authorGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-08-01 00:30:11 +0000
committerGravatar kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-08-01 00:30:11 +0000
commit1900c536cd91bae783e6766d3fc016e75061d17c (patch)
treeaa80b27f89c8a4029695089a451249e9e2223c3b /src/google/protobuf/extension_set.h
parent39671e530974555d09ab6c7fcfed4114a80c5ed3 (diff)
Fix compile for GCC 3.4.4.
Diffstat (limited to 'src/google/protobuf/extension_set.h')
-rw-r--r--src/google/protobuf/extension_set.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/google/protobuf/extension_set.h b/src/google/protobuf/extension_set.h
index 8c1d73b8..8c0f12a5 100644
--- a/src/google/protobuf/extension_set.h
+++ b/src/google/protobuf/extension_set.h
@@ -61,6 +61,7 @@ namespace protobuf {
}
namespace internal {
class FieldSkipper; // wire_format_lite.h
+ class RepeatedPtrFieldBase; // repeated_field.h
}
template <typename Element> class RepeatedField; // repeated_field.h
template <typename Element> class RepeatedPtrField; // repeated_field.h
@@ -388,6 +389,15 @@ class LIBPROTOBUF_EXPORT ExtensionSet {
const MessageLite* containing_type,
FieldSkipper* field_skipper);
+ // Hack: RepeatedPtrFieldBase declares ExtensionSet as a friend. This
+ // friendship should automatically extend to ExtensionSet::Extension, but
+ // unfortunately some older compilers (e.g. GCC 3.4.4) do not implement this
+ // correctly. So, we must provide helpers for calling methods of that
+ // class.
+
+ // Defined in extension_set_heavy.cc.
+ static inline int RepeatedMessage_SpaceUsedExcludingSelf(
+ RepeatedPtrFieldBase* field);
// The Extension struct is small enough to be passed by value, so we use it
// directly as the value type in the map rather than use pointers. We use