diff options
author | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-04-28 02:10:27 +0000 |
---|---|---|
committer | kenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d> | 2009-04-28 02:10:27 +0000 |
commit | 30be0a875899d07fd301d4fb0a8e55aa31533a2e (patch) | |
tree | 6ac46d0f588bcb38058e7592c08a8951ba2d5e81 /src/google | |
parent | 41c3760f2fd59b19965a9165d661bfab3c5c80d6 (diff) | |
download | protobuf-30be0a875899d07fd301d4fb0a8e55aa31533a2e.tar.gz protobuf-30be0a875899d07fd301d4fb0a8e55aa31533a2e.tar.bz2 protobuf-30be0a875899d07fd301d4fb0a8e55aa31533a2e.zip |
Don't use dll-export declspec on class-nested extensions.
Diffstat (limited to 'src/google')
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_extension.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_extension.cc b/src/google/protobuf/compiler/cpp/cpp_extension.cc index 61ebda73..cd4806ba 100644 --- a/src/google/protobuf/compiler/cpp/cpp_extension.cc +++ b/src/google/protobuf/compiler/cpp/cpp_extension.cc @@ -89,12 +89,15 @@ void ExtensionGenerator::GenerateDeclaration(io::Printer* printer) { vars["constant_name"] = FieldConstantName(descriptor_); // If this is a class member, it needs to be declared "static". Otherwise, - // it needs to be "extern". - vars["qualifier"] = - (descriptor_->extension_scope() == NULL) ? "extern" : "static"; - - if (!dllexport_decl_.empty()) { - vars["qualifier"] = dllexport_decl_ + " " + vars["qualifier"]; + // it needs to be "extern". In the latter case, it also needs the DLL + // export/import specifier. + if (descriptor_->extension_scope() == NULL) { + vars["qualifier"] = "extern"; + if (!dllexport_decl_.empty()) { + vars["qualifier"] = dllexport_decl_ + " " + vars["qualifier"]; + } + } else { + vars["qualifier"] = "static"; } printer->Print(vars, |