Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
1900c536
Commit
1900c536
authored
Aug 01, 2009
by
kenton@google.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile for GCC 3.4.4.
parent
39671e53
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
3 deletions
+16
-3
extension_set.h
src/google/protobuf/extension_set.h
+10
-0
extension_set_heavy.cc
src/google/protobuf/extension_set_heavy.cc
+6
-3
No files found.
src/google/protobuf/extension_set.h
View file @
1900c536
...
...
@@ -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
...
...
src/google/protobuf/extension_set_heavy.cc
View file @
1900c536
...
...
@@ -165,6 +165,11 @@ int ExtensionSet::SpaceUsedExcludingSelf() const {
return
total_size
;
}
inline
int
ExtensionSet
::
RepeatedMessage_SpaceUsedExcludingSelf
(
RepeatedPtrFieldBase
*
field
)
{
return
field
->
SpaceUsedExcludingSelf
<
GenericTypeHandler
<
Message
>
>
();
}
int
ExtensionSet
::
Extension
::
SpaceUsedExcludingSelf
()
const
{
int
total_size
=
0
;
if
(
is_repeated
)
{
...
...
@@ -191,9 +196,7 @@ int ExtensionSet::Extension::SpaceUsedExcludingSelf() const {
// RepeatedPtrFieldBase::SpaceUsedExcludingSelf() with a different type
// handler.
total_size
+=
sizeof
(
*
repeated_message_value
)
+
repeated_message_value
->
RepeatedPtrFieldBase
::
SpaceUsedExcludingSelf
<
GenericTypeHandler
<
Message
>
>
();
RepeatedMessage_SpaceUsedExcludingSelf
(
repeated_message_value
);
break
;
}
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment