From 117064c18b13dfe2e46f26b6dabe986c44f60fcd Mon Sep 17 00:00:00 2001 From: "liujisi@google.com" Date: Fri, 11 Jan 2013 10:35:05 +0000 Subject: [PATCH] add missing dll export macros for msvc. --- src/google/protobuf/compiler/java/java_doc_comment.h | 2 +- src/google/protobuf/compiler/subprocess.h | 2 +- src/google/protobuf/message.cc | 4 ++-- src/google/protobuf/stubs/once.h | 1 + src/google/protobuf/stubs/stringprintf.h | 12 ++++++------ 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/google/protobuf/compiler/java/java_doc_comment.h b/src/google/protobuf/compiler/java/java_doc_comment.h index f77720b6..7244d9ba 100644 --- a/src/google/protobuf/compiler/java/java_doc_comment.h +++ b/src/google/protobuf/compiler/java/java_doc_comment.h @@ -59,7 +59,7 @@ void WriteMethodDocComment(io::Printer* printer, const MethodDescriptor* method); // Exposed for testing only. -string EscapeJavadoc(const string& input); +LIBPROTOC_EXPORT string EscapeJavadoc(const string& input); } // namespace java } // namespace compiler diff --git a/src/google/protobuf/compiler/subprocess.h b/src/google/protobuf/compiler/subprocess.h index de9fce9e..00564964 100644 --- a/src/google/protobuf/compiler/subprocess.h +++ b/src/google/protobuf/compiler/subprocess.h @@ -53,7 +53,7 @@ class Message; namespace compiler { // Utility class for launching sub-processes. -class Subprocess { +class LIBPROTOC_EXPORT Subprocess { public: Subprocess(); ~Subprocess(); diff --git a/src/google/protobuf/message.cc b/src/google/protobuf/message.cc index 6119d26a..441be534 100644 --- a/src/google/protobuf/message.cc +++ b/src/google/protobuf/message.cc @@ -188,7 +188,7 @@ bool Message::SerializePartialToOstream(ostream* output) const { Reflection::~Reflection() {} #define HANDLE_TYPE(TYPE, CPPTYPE, CTYPE) \ -template<> \ +template<> LIBPROTOBUF_EXPORT \ const RepeatedField& Reflection::GetRepeatedField( \ const Message& message, const FieldDescriptor* field) const { \ return *static_cast* >( \ @@ -196,7 +196,7 @@ const RepeatedField& Reflection::GetRepeatedField( \ field, CPPTYPE, CTYPE, NULL)); \ } \ \ -template<> \ +template<> LIBPROTOBUF_EXPORT \ RepeatedField* Reflection::MutableRepeatedField( \ Message* message, const FieldDescriptor* field) const { \ return static_cast* >( \ diff --git a/src/google/protobuf/stubs/once.h b/src/google/protobuf/stubs/once.h index c8cbe246..7fbc117f 100644 --- a/src/google/protobuf/stubs/once.h +++ b/src/google/protobuf/stubs/once.h @@ -118,6 +118,7 @@ typedef internal::AtomicWord ProtobufOnceType; #define GOOGLE_PROTOBUF_ONCE_INIT ::google::protobuf::ONCE_STATE_UNINITIALIZED +LIBPROTOBUF_EXPORT void GoogleOnceInitImpl(ProtobufOnceType* once, Closure* closure); inline void GoogleOnceInit(ProtobufOnceType* once, void (*init_func)()) { diff --git a/src/google/protobuf/stubs/stringprintf.h b/src/google/protobuf/stubs/stringprintf.h index 573f30f3..4a03e5ff 100644 --- a/src/google/protobuf/stubs/stringprintf.h +++ b/src/google/protobuf/stubs/stringprintf.h @@ -50,25 +50,25 @@ namespace google { namespace protobuf { // Return a C++ string -extern string StringPrintf(const char* format, ...); +LIBPROTOBUF_EXPORT extern string StringPrintf(const char* format, ...); // Store result into a supplied string and return it -extern const string& SStringPrintf(string* dst, const char* format, ...); +LIBPROTOBUF_EXPORT extern const string& SStringPrintf(string* dst, const char* format, ...); // Append result to a supplied string -extern void StringAppendF(string* dst, const char* format, ...); +LIBPROTOBUF_EXPORT extern void StringAppendF(string* dst, const char* format, ...); // Lower-level routine that takes a va_list and appends to a specified // string. All other routines are just convenience wrappers around it. -extern void StringAppendV(string* dst, const char* format, va_list ap); +LIBPROTOBUF_EXPORT extern void StringAppendV(string* dst, const char* format, va_list ap); // The max arguments supported by StringPrintfVector -extern const int kStringPrintfVectorMaxArgs; +LIBPROTOBUF_EXPORT extern const int kStringPrintfVectorMaxArgs; // You can use this version when all your arguments are strings, but // you don't know how many arguments you'll have at compile time. // StringPrintfVector will LOG(FATAL) if v.size() > kStringPrintfVectorMaxArgs -extern string StringPrintfVector(const char* format, const vector& v); +LIBPROTOBUF_EXPORT extern string StringPrintfVector(const char* format, const vector& v); } // namespace protobuf } // namespace google