浏览代码

Merge pull request #2398 from jbrianceau/no-static-init-define-fix

C++: Fix use with GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER
Feng Xiao 9 年之前
父节点
当前提交
b7632464b4
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/google/protobuf/compiler/cpp/cpp_file.cc

+ 1 - 1
src/google/protobuf/compiler/cpp/cpp_file.cc

@@ -722,7 +722,7 @@ void FileGenerator::GenerateBuildDescriptors(io::Printer* printer) {
       "adddescriptorsname", GlobalAddDescriptorsName(file_->name()));
 
   if (!StaticInitializersForced(file_, options_)) {
-    printer->Print("#ifdef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n");
+    printer->Print("#ifndef GOOGLE_PROTOBUF_NO_STATIC_INITIALIZER\n");
   }
   printer->Print(
       // With static initializers.