From ee35402244fc463cedc470baa0f5f1a6080d905d Mon Sep 17 00:00:00 2001 From: Karol Ostrovsky Date: Mon, 29 Jun 2015 16:13:33 +0200 Subject: MinGW64+MSYS2 compilation issues and portable isnan using MathLimits --- src/google/protobuf/text_format_unittest.cc | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/google/protobuf/text_format_unittest.cc') diff --git a/src/google/protobuf/text_format_unittest.cc b/src/google/protobuf/text_format_unittest.cc index 1b18c5ed..76ce9875 100644 --- a/src/google/protobuf/text_format_unittest.cc +++ b/src/google/protobuf/text_format_unittest.cc @@ -46,6 +46,7 @@ #include #include #include +#include #include #include #include @@ -57,11 +58,6 @@ namespace protobuf { // Can't use an anonymous namespace here due to brokenness of Tru64 compiler. namespace text_format_unittest { -inline bool IsNaN(double value) { - // NaN is never equal to anything, even itself. - return value != value; -} - // A basic string with different escapable characters for testing. const string kEscapeTestString = "\"A string with ' characters \n and \r newlines and \t tabs and \001 " @@ -898,8 +894,8 @@ TEST_F(TextFormatTest, ParseExotic) { EXPECT_EQ(message.repeated_double(8), numeric_limits::infinity()); EXPECT_EQ(message.repeated_double(9), -numeric_limits::infinity()); EXPECT_EQ(message.repeated_double(10), -numeric_limits::infinity()); - EXPECT_TRUE(IsNaN(message.repeated_double(11))); - EXPECT_TRUE(IsNaN(message.repeated_double(12))); + EXPECT_TRUE(MathLimits::IsNaN(message.repeated_double(11))); + EXPECT_TRUE(MathLimits::IsNaN(message.repeated_double(12))); // Note: Since these string literals have \0's in them, we must explicitly // pass their sizes to string's constructor. -- cgit v1.2.3