Index: third_party/protobuf/src/google/protobuf/stubs/common.cc |
diff --git a/third_party/protobuf/src/google/protobuf/stubs/common.cc b/third_party/protobuf/src/google/protobuf/stubs/common.cc |
index e6045026774246225433ac84a1eb0eb12e92f099..d470fc7265c1107564e2e3f636aacac645319f33 100644 |
--- a/third_party/protobuf/src/google/protobuf/stubs/common.cc |
+++ b/third_party/protobuf/src/google/protobuf/stubs/common.cc |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// http://code.google.com/p/protobuf/ |
+// https://developers.google.com/protocol-buffers/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -32,12 +32,13 @@ |
#include <google/protobuf/stubs/common.h> |
#include <google/protobuf/stubs/once.h> |
+#include <google/protobuf/stubs/status.h> |
+#include <google/protobuf/stubs/stringpiece.h> |
+#include <google/protobuf/stubs/strutil.h> |
#include <stdio.h> |
#include <errno.h> |
#include <vector> |
-#include "config.h" |
- |
#ifdef _WIN32 |
#define WIN32_LEAN_AND_MEAN // We only need minimal includes |
#include <windows.h> |
@@ -115,8 +116,8 @@ void DefaultLogHandler(LogLevel level, const char* filename, int line, |
fflush(stderr); // Needed on MSVC. |
} |
-void NullLogHandler(LogLevel level, const char* filename, int line, |
- const string& message) { |
+void NullLogHandler(LogLevel /* level */, const char* /* filename */, |
+ int /* line */, const string& /* message */) { |
// Nothing. |
} |
@@ -148,6 +149,27 @@ LogMessage& LogMessage::operator<<(const char* value) { |
return *this; |
} |
+LogMessage& LogMessage::operator<<(const StringPiece& value) { |
+ message_ += value.ToString(); |
+ return *this; |
+} |
+ |
+LogMessage& LogMessage::operator<<(long long value) { |
+ message_ += SimpleItoa(value); |
+ return *this; |
+} |
+ |
+LogMessage& LogMessage::operator<<(unsigned long long value) { |
+ message_ += SimpleItoa(value); |
+ return *this; |
+} |
+ |
+LogMessage& LogMessage::operator<<( |
+ const ::google::protobuf::util::Status& status) { |
+ message_ += status.ToString(); |
+ return *this; |
+} |
+ |
// Since this is just for logging, we don't care if the current locale changes |
// the results -- in fact, we probably prefer that. So we use snprintf() |
// instead of Simple*toa(). |
@@ -167,10 +189,11 @@ LogMessage& LogMessage::operator<<(const char* value) { |
DECLARE_STREAM_OPERATOR(char , "%c" ) |
DECLARE_STREAM_OPERATOR(int , "%d" ) |
-DECLARE_STREAM_OPERATOR(uint , "%u" ) |
+DECLARE_STREAM_OPERATOR(unsigned int , "%u" ) |
DECLARE_STREAM_OPERATOR(long , "%ld") |
DECLARE_STREAM_OPERATOR(unsigned long, "%lu") |
DECLARE_STREAM_OPERATOR(double , "%g" ) |
+DECLARE_STREAM_OPERATOR(void* , "%p" ) |
#undef DECLARE_STREAM_OPERATOR |
LogMessage::LogMessage(LogLevel level, const char* filename, int line) |