Avoid two consecutive underscores in macro name.

Fixes https://github.com/google/protobuf/issues/3268
This commit is contained in:
Feng Xiao 2017-12-13 13:40:19 -08:00
parent 0a7120ac32
commit 50ef6a623e

View File

@ -1145,8 +1145,8 @@ void FileGenerator::GenerateTopHeaderGuard(io::Printer* printer,
"// Generated by the protocol buffer compiler. DO NOT EDIT!\n"
"// source: $filename$\n"
"\n"
"#ifndef PROTOBUF_$filename_identifier$__INCLUDED\n"
"#define PROTOBUF_$filename_identifier$__INCLUDED\n"
"#ifndef PROTOBUF_$filename_identifier$_INCLUDED\n"
"#define PROTOBUF_$filename_identifier$_INCLUDED\n"
"\n"
"#include <string>\n",
"filename", file_->name(), "filename_identifier", filename_identifier);
@ -1156,7 +1156,7 @@ void FileGenerator::GenerateTopHeaderGuard(io::Printer* printer,
void FileGenerator::GenerateBottomHeaderGuard(
io::Printer* printer, const string& filename_identifier) {
printer->Print(
"#endif // PROTOBUF_$filename_identifier$__INCLUDED\n",
"#endif // PROTOBUF_$filename_identifier$_INCLUDED\n",
"filename_identifier", filename_identifier);
}