Skip to content

Commit

Permalink
Fixed DLL compile under MSVC.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenton@google.com committed Jan 4, 2010
1 parent c619a3d commit d78ca9c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 2 additions & 18 deletions src/google/protobuf/extension_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
19 changes: 19 additions & 0 deletions src/google/protobuf/extension_set_heavy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<const FieldDescriptor*>* output) const {
Expand Down
4 changes: 2 additions & 2 deletions src/google/protobuf/generated_message_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/repeated_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d78ca9c

Please sign in to comment.