diff options
Diffstat (limited to 'extern/glog/src/windows/glog/logging.h')
-rw-r--r-- | extern/glog/src/windows/glog/logging.h | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/extern/glog/src/windows/glog/logging.h b/extern/glog/src/windows/glog/logging.h index f521a2b9424..3681fa3fcc4 100644 --- a/extern/glog/src/windows/glog/logging.h +++ b/extern/glog/src/windows/glog/logging.h @@ -572,8 +572,10 @@ class LogSink; // defined below LOG_TO_STRING_##severity(static_cast<std::vector<std::string>*>(outvec)).stream() #define LOG_IF(severity, condition) \ + static_cast<void>(0), \ !(condition) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) #define SYSLOG_IF(severity, condition) \ + static_cast<void>(0), \ !(condition) ? (void) 0 : google::LogMessageVoidify() & SYSLOG(severity) #define LOG_ASSERT(condition) \ @@ -863,6 +865,7 @@ DECLARE_CHECK_STROP_IMPL(strcasecmp, false) &google::LogMessage::SendToLog) #define PLOG_IF(severity, condition) \ + static_cast<void>(0), \ !(condition) ? (void) 0 : google::LogMessageVoidify() & PLOG(severity) // A CHECK() macro that postpends errno if the condition is false. E.g. @@ -935,16 +938,11 @@ struct CompileAssert { struct CrashReason; // Returns true if FailureSignalHandler is installed. -bool IsFailureSignalHandlerInstalled(); +// Needs to be exported since it's used by the signalhandler_unittest. +GOOGLE_GLOG_DLL_DECL bool IsFailureSignalHandlerInstalled(); } // namespace glog_internal_namespace_ -#define GOOGLE_GLOG_COMPILE_ASSERT(expr, msg) \ - typedef google::glog_internal_namespace_::CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] - #define LOG_EVERY_N(severity, n) \ - GOOGLE_GLOG_COMPILE_ASSERT(google::GLOG_ ## severity < \ - google::NUM_SEVERITIES, \ - INVALID_REQUESTED_LOG_SEVERITY); \ SOME_KIND_OF_LOG_EVERY_N(severity, (n), google::LogMessage::SendToLog) #define SYSLOG_EVERY_N(severity, n) \ @@ -1012,23 +1010,29 @@ const LogSeverity GLOG_0 = GLOG_ERROR; #else // !DCHECK_IS_ON() -#define DLOG(severity) \ +#define DLOG(severity) \ + static_cast<void>(0), \ true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) -#define DVLOG(verboselevel) \ - (true || !VLOG_IS_ON(verboselevel)) ?\ +#define DVLOG(verboselevel) \ + static_cast<void>(0), \ + (true || !VLOG_IS_ON(verboselevel)) ? \ (void) 0 : google::LogMessageVoidify() & LOG(INFO) #define DLOG_IF(severity, condition) \ + static_cast<void>(0), \ (true || !(condition)) ? (void) 0 : google::LogMessageVoidify() & LOG(severity) #define DLOG_EVERY_N(severity, n) \ + static_cast<void>(0), \ true ? (void) 0 : google::LogMessageVoidify() & LOG(severity) #define DLOG_IF_EVERY_N(severity, condition, n) \ + static_cast<void>(0), \ (true || !(condition))? (void) 0 : google::LogMessageVoidify() & LOG(severity) #define DLOG_ASSERT(condition) \ + static_cast<void>(0), \ true ? (void) 0 : LOG_ASSERT(condition) // MSVC warning C4127: conditional expression is constant @@ -1113,10 +1117,11 @@ namespace base_logging { // buffer to allow for a '\n' and '\0'. class GOOGLE_GLOG_DLL_DECL LogStreamBuf : public std::streambuf { public: - // REQUIREMENTS: "len" must be >= 2 to account for the '\n' and '\n'. + // REQUIREMENTS: "len" must be >= 2 to account for the '\n' and '\0'. LogStreamBuf(char *buf, int len) { setp(buf, buf + len - 2); } + // This effectively ignores overflow. virtual int_type overflow(int_type ch) { return ch; @@ -1155,13 +1160,9 @@ public: // 2005 if you are deriving from a type in the Standard C++ Library" // http://msdn.microsoft.com/en-us/library/3tdb471s(VS.80).aspx // Let's just ignore the warning. -#ifdef _MSC_VER -# pragma warning(disable: 4275) -#endif +GLOG_MSVC_PUSH_DISABLE_WARNING(4275) class GOOGLE_GLOG_DLL_DECL LogStream : public std::ostream { -#ifdef _MSC_VER -# pragma warning(default: 4275) -#endif +GLOG_MSVC_POP_WARNING() public: LogStream(char *buf, int len, int ctr) : std::ostream(NULL), |