mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-22 23:26:14 -08:00
Support MacOS 12 & 13. Support Protobuf 23. Deprecate MacOS 11. (#4884)
This commit is contained in:
@@ -8,15 +8,6 @@
|
||||
#include <google/protobuf/message.h>
|
||||
#include <google/protobuf/text_format.h>
|
||||
|
||||
// google/protobuf/stubs/strutil.h is missing on some systems!
|
||||
namespace google
|
||||
{
|
||||
namespace protobuf
|
||||
{
|
||||
std::string CEscape(const std::string &src);
|
||||
} // namespace protobuf
|
||||
} // namespace google
|
||||
|
||||
// FastFieldValuePrinter is added in protobuf 3.4, going out of our way to add the old FieldValuePrinter is not worth it
|
||||
#if GOOGLE_PROTOBUF_VERSION > 3004000
|
||||
|
||||
@@ -44,8 +35,8 @@ void LimitedPrinter::PrintString(const std::string &val,
|
||||
{
|
||||
auto length = val.length();
|
||||
if (length > MAX_TEXT_LENGTH) {
|
||||
generator->PrintString("\"" + ::google::protobuf::CEscape(val.substr(0, MAX_NAME_LENGTH)) + "... ---snip--- (" +
|
||||
std::to_string(length) + " bytes total) \"");
|
||||
::google::protobuf::TextFormat::FastFieldValuePrinter::PrintString(
|
||||
val.substr(0, MAX_NAME_LENGTH) + "... ---snip--- (" + std::to_string(length) + " bytes total", generator);
|
||||
} else {
|
||||
::google::protobuf::TextFormat::FastFieldValuePrinter::PrintString(val, generator);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user