diff options
author | Feng Xiao <xiaofeng@google.com> | 2016-11-11 16:22:16 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-11 16:22:16 -0800 |
commit | a30e5af2043c805abcbebd07db4c8cbe2779a430 (patch) | |
tree | 44f1dabf8df65732d9c10a2c08111855526e9bf0 | |
parent | 8a4b2c573a8f452cdb4e8e04841bfa5f21738e12 (diff) | |
parent | e02cb2bb8369f2a97461c5d300ffaca247792183 (diff) | |
download | protobuf-a30e5af2043c805abcbebd07db4c8cbe2779a430.tar.gz protobuf-a30e5af2043c805abcbebd07db4c8cbe2779a430.tar.bz2 protobuf-a30e5af2043c805abcbebd07db4c8cbe2779a430.zip |
Merge pull request #2358 from ckennelly/master
Resolve old TODO for StringTypeHandler.
-rw-r--r-- | src/google/protobuf/repeated_field.h | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index 0a41495f..6ede0e1a 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -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); } |