diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d63f62d16..aa0dd4a8d 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -26,6 +26,7 @@ Abhishek Dasgupta Abhishek Parmar Andrew Schwartzmeyer Andy Ying +Bret McKee Brian Silverman Fumitoshi Ukai Guillaume Dumont diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in index 9968b96d3..193622d5d 100644 --- a/src/glog/logging.h.in +++ b/src/glog/logging.h.in @@ -649,6 +649,13 @@ void MakeCheckOpValueString(std::ostream* os, const signed char& v); template <> GOOGLE_GLOG_DLL_DECL void MakeCheckOpValueString(std::ostream* os, const unsigned char& v); +// This is required because nullptr is only present in c++ 11 and later. +#if __cplusplus >= 201103L +// Provide printable value for nullptr_t +template <> GOOGLE_GLOG_DLL_DECL +void MakeCheckOpValueString(std::ostream* os, const std::nullptr_t& v); +#endif + // Build the error message string. Specify no inlining for code size. template std::string* MakeCheckOpString(const T1& v1, const T2& v2, const char* exprtext) diff --git a/src/logging.cc b/src/logging.cc index 0c86cf622..601123f00 100644 --- a/src/logging.cc +++ b/src/logging.cc @@ -2163,6 +2163,13 @@ void MakeCheckOpValueString(std::ostream* os, const unsigned char& v) { } } +#if __cplusplus >= 201103L +template <> +void MakeCheckOpValueString(std::ostream* os, const std::nullptr_t& v) { + (*os) << "nullptr"; +} +#endif + void InitGoogleLogging(const char* argv0) { glog_internal_namespace_::InitGoogleLoggingUtilities(argv0); }