Commit f47a2df5 authored by zhanyong.wan's avatar zhanyong.wan
Browse files

Makes gmock compile on minGW, which uses gcc 3.4.5.

parent a89034c8
...@@ -279,9 +279,12 @@ void DefaultPrintTo(IsNotContainer /* dummy */, ...@@ -279,9 +279,12 @@ void DefaultPrintTo(IsNotContainer /* dummy */,
if (p == NULL) { if (p == NULL) {
*os << "NULL"; *os << "NULL";
} else { } else {
// We cannot use implicit_cast or static_cast here, as they don't // We want to print p as a const void*. However, we cannot cast
// work when p is a function pointer. // it to const void* directly, even using reinterpret_cast, as
*os << reinterpret_cast<const void*>(p); // earlier versions of gcc (e.g. 3.4.5) cannot compile the cast
// when p is a function pointer. Casting to UInt64 first solves
// the problem.
*os << reinterpret_cast<const void*>(reinterpret_cast<internal::UInt64>(p));
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment