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
a30e5af2
Commit
a30e5af2
authored
8 years ago
by
Feng Xiao
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2358 from ckennelly/master
Resolve old TODO for StringTypeHandler.
parents
8a4b2c57
e02cb2bb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
15 deletions
+1
-15
repeated_field.h
src/google/protobuf/repeated_field.h
+1
-15
No files found.
src/google/protobuf/repeated_field.h
View file @
a30e5af2
...
...
@@ -681,17 +681,7 @@ inline const Message& GenericTypeHandler<Message>::default_instance() {
return
*
null
;
}
// HACK: If a class is declared as DLL-exported in MSVC, it insists on
// generating copies of all its methods -- even inline ones -- to include
// in the DLL. But SpaceUsed() calls StringSpaceUsedExcludingSelf() which
// isn't in the lite library, therefore the lite library cannot link if
// StringTypeHandler is exported. So, we factor out StringTypeHandlerBase,
// export that, then make StringTypeHandler be a subclass which is NOT
// exported.
// TODO(kenton): Now that StringSpaceUsedExcludingSelf() is in the lite
// library, this can be cleaned up.
class
LIBPROTOBUF_EXPORT
StringTypeHandlerBase
{
class
LIBPROTOBUF_EXPORT
StringTypeHandler
{
public
:
typedef
string
Type
;
...
...
@@ -718,10 +708,6 @@ class LIBPROTOBUF_EXPORT StringTypeHandlerBase {
static
inline
const
Type
&
default_instance
()
{
return
::
google
::
protobuf
::
internal
::
GetEmptyString
();
}
};
class
StringTypeHandler
:
public
StringTypeHandlerBase
{
public
:
static
int
SpaceUsed
(
const
string
&
value
)
{
return
static_cast
<
int
>
(
sizeof
(
value
))
+
StringSpaceUsedExcludingSelf
(
value
);
}
...
...
This diff is collapsed.
Click to expand it.
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