diff options
Diffstat (limited to 'src/google/protobuf/compiler/cpp/cpp_enum.cc')
-rw-r--r-- | src/google/protobuf/compiler/cpp/cpp_enum.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/google/protobuf/compiler/cpp/cpp_enum.cc b/src/google/protobuf/compiler/cpp/cpp_enum.cc index de4d7cc7..1a11bce8 100644 --- a/src/google/protobuf/compiler/cpp/cpp_enum.cc +++ b/src/google/protobuf/compiler/cpp/cpp_enum.cc @@ -278,9 +278,9 @@ void EnumGenerator::GenerateMethods(io::Printer* printer) { if (descriptor_->containing_type() != NULL) { // We need to "define" the static constants which were declared in the // header, to give the linker a place to put them. Or at least the C++ - // standard says we have to. MSVC actually insists tha we do _not_ define - // them again in the .cc file. - printer->Print("#ifndef _MSC_VER\n"); + // standard says we have to. MSVC actually insists that we do _not_ define + // them again in the .cc file, prior to VC++ 2015. + printer->Print("#if !defined(_MSC_VER) || _MSC_VER >= 1900\n"); vars["parent"] = ClassName(descriptor_->containing_type(), false); vars["nested_name"] = descriptor_->name(); @@ -297,7 +297,7 @@ void EnumGenerator::GenerateMethods(io::Printer* printer) { "const int $parent$::$nested_name$_ARRAYSIZE;\n"); } - printer->Print("#endif // _MSC_VER\n"); + printer->Print("#endif // !defined(_MSC_VER) || _MSC_VER >= 1900\n"); } } |