From d78ca9c74f66005ae48efb8921bd305260567935 Mon Sep 17 00:00:00 2001 From: "kenton@google.com" Date: Mon, 4 Jan 2010 21:15:47 +0000 Subject: Fixed DLL compile under MSVC. --- src/google/protobuf/compiler/plugin.h | 2 +- src/google/protobuf/extension_set.h | 20 ++------------------ src/google/protobuf/extension_set_heavy.cc | 19 +++++++++++++++++++ src/google/protobuf/generated_message_util.h | 4 ++-- src/google/protobuf/repeated_field.h | 2 +- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/src/google/protobuf/compiler/plugin.h b/src/google/protobuf/compiler/plugin.h index 32ba55ba..4731b47b 100644 --- a/src/google/protobuf/compiler/plugin.h +++ b/src/google/protobuf/compiler/plugin.h @@ -47,7 +47,7 @@ class CodeGenerator; // code_generator.h // MyCodeGenerator generator; // return PluginMain(argc, argv, &generator); // } -int PluginMain(int argc, char* argv[], const CodeGenerator* generator); +LIBPROTOC_EXPORT int PluginMain(int argc, char* argv[], const CodeGenerator* generator); } // namespace compiler } // namespace protobuf diff --git a/src/google/protobuf/extension_set.h b/src/google/protobuf/extension_set.h index e05de3fb..ffacf56b 100644 --- a/src/google/protobuf/extension_set.h +++ b/src/google/protobuf/extension_set.h @@ -136,24 +136,8 @@ class LIBPROTOBUF_EXPORT GeneratedExtensionFinder : public ExtensionFinder { const MessageLite* containing_type_; }; -// Implementation of ExtensionFinder which finds extensions in a given -// DescriptorPool, using the given MessageFactory to construct sub-objects. -// This class is implemented in extension_set_heavy.cc. -class LIBPROTOBUF_EXPORT DescriptorPoolExtensionFinder : public ExtensionFinder { - public: - DescriptorPoolExtensionFinder(const DescriptorPool* pool, - MessageFactory* factory, - const Descriptor* containing_type) - : pool_(pool), factory_(factory), containing_type_(containing_type) {} - virtual ~DescriptorPoolExtensionFinder() {} - - virtual bool Find(int number, ExtensionInfo* output); - - private: - const DescriptorPool* pool_; - MessageFactory* factory_; - const Descriptor* containing_type_; -}; +// Note: extension_set_heavy.cc defines DescriptorPoolExtensionFinder for +// finding extensions from a DescriptorPool. // This is an internal helper class intended for use within the protocol buffer // library and generated classes. Clients should not use it directly. Instead, diff --git a/src/google/protobuf/extension_set_heavy.cc b/src/google/protobuf/extension_set_heavy.cc index 27f2bc8b..2721f15d 100644 --- a/src/google/protobuf/extension_set_heavy.cc +++ b/src/google/protobuf/extension_set_heavy.cc @@ -46,6 +46,25 @@ namespace google { namespace protobuf { namespace internal { +// Implementation of ExtensionFinder which finds extensions in a given +// DescriptorPool, using the given MessageFactory to construct sub-objects. +// This class is implemented in extension_set_heavy.cc. +class DescriptorPoolExtensionFinder : public ExtensionFinder { + public: + DescriptorPoolExtensionFinder(const DescriptorPool* pool, + MessageFactory* factory, + const Descriptor* containing_type) + : pool_(pool), factory_(factory), containing_type_(containing_type) {} + virtual ~DescriptorPoolExtensionFinder() {} + + virtual bool Find(int number, ExtensionInfo* output); + + private: + const DescriptorPool* pool_; + MessageFactory* factory_; + const Descriptor* containing_type_; +}; + void ExtensionSet::AppendToList(const Descriptor* containing_type, const DescriptorPool* pool, vector* output) const { diff --git a/src/google/protobuf/generated_message_util.h b/src/google/protobuf/generated_message_util.h index f306a2f1..daa16f77 100644 --- a/src/google/protobuf/generated_message_util.h +++ b/src/google/protobuf/generated_message_util.h @@ -66,8 +66,8 @@ namespace internal { // Constants for special floating point values. -double Infinity(); -double NaN(); +LIBPROTOBUF_EXPORT double Infinity(); +LIBPROTOBUF_EXPORT double NaN(); } // namespace internal diff --git a/src/google/protobuf/repeated_field.h b/src/google/protobuf/repeated_field.h index 5954db55..defdefe0 100644 --- a/src/google/protobuf/repeated_field.h +++ b/src/google/protobuf/repeated_field.h @@ -300,7 +300,7 @@ class LIBPROTOBUF_EXPORT StringTypeHandlerBase { static void Merge(const string& from, string* to) { *to = from; } }; -class LIBPROTOBUF_EXPORT StringTypeHandler : public StringTypeHandlerBase { +class StringTypeHandler : public StringTypeHandlerBase { public: static int SpaceUsed(const string& value) { return sizeof(value) + StringSpaceUsedExcludingSelf(value); -- cgit v1.2.3