Corrects condition to compile out MSVC's pragmas. This fixes the build on MinGW.

This commit is contained in:
vladlosev 2011-04-13 22:12:00 +00:00
parent ab29bb6fcd
commit e73cf452a5

View File

@ -1392,15 +1392,15 @@ class TrulyMatcher {
template <typename T> template <typename T>
bool MatchAndExplain(T& x, // NOLINT bool MatchAndExplain(T& x, // NOLINT
MatchResultListener* /* listener */) const { MatchResultListener* /* listener */) const {
#if GTEST_OS_WINDOWS #if _MSC_VER
// MSVC warns about converting a value into bool (warning 4800). // MSVC warns about converting a value into bool (warning 4800).
# pragma warning(push) // Saves the current warning state. # pragma warning(push) // Saves the current warning state.
# pragma warning(disable:4800) // Temporarily disables warning 4800. # pragma warning(disable:4800) // Temporarily disables warning 4800.
#endif // GTEST_OS_WINDOWS #endif
return predicate_(x); return predicate_(x);
#if GTEST_OS_WINDOWS #if _MSC_VER
# pragma warning(pop) // Restores the warning state. # pragma warning(pop) // Restores the warning state.
#endif // GTEST_OS_WINDOWS #endif
} }
void DescribeTo(::std::ostream* os) const { void DescribeTo(::std::ostream* os) const {