Unreviewed build fix.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jul 2012 19:30:11 +0000 (19:30 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 Jul 2012 19:30:11 +0000 (19:30 +0000)
Source/WTF:

Use MathExtras.h and the non std:: versions of isnan and signbit.

* wtf/MediaTime.cpp:
(WTF::MediaTime::createWithFloat):
(WTF::MediaTime::createWithDouble):

Tools:

Wrap MSVC-specific fixes is a COMPILER() check, not a PLATFORM() check.

* TestWebKitAPI/Tests/WTF/MediaTime.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123906 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WTF/ChangeLog
Source/WTF/wtf/MediaTime.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WTF/MediaTime.cpp

index bb2d6c5a4c6d2a161f7cbb48bbf615aadaad231d..4a8062194b952bcf30dac233e090621d9097db96 100644 (file)
@@ -1,3 +1,13 @@
+2012-07-27  Jer Noble  <jer.noble@apple.com>
+
+        Unreviewed build fix.
+
+        Use MathExtras.h and the non std:: versions of isnan and signbit.
+
+        * wtf/MediaTime.cpp:
+        (WTF::MediaTime::createWithFloat):
+        (WTF::MediaTime::createWithDouble):
+
 2012-07-27  Jer Noble  <jer.noble@apple.com>
 
         Support a rational time class for use by media elements.
index ce58bc2e137c028b9f3d1697b51fc7c6f352f889..6eb2bb09ba7f1ab4750f0acacec0dc47ee7ed0d3 100644 (file)
 
 #include <algorithm>
 #include <wtf/CheckedArithmetic.h>
-
-#if PLATFORM(WIN)
-// Work around Visual Studio 2008's lack of an isinf or signbit method in STL.
-namespace std {
-    static bool isinf(double number) { return !_finite(number) && !_isnan(number); }
-    static int signbit(double number) { return number < 0; }
-}
-#endif
+#include <wtf/MathExtras.h>
 
 using namespace std;
 
@@ -90,8 +83,8 @@ MediaTime MediaTime::createWithFloat(float floatTime, int32_t timeScale)
 {
     if (floatTime != floatTime)
         return invalidTime();
-    if (std::isinf(floatTime))
-        return std::signbit(floatTime) ? negativeInfiniteTime() : positiveInfiniteTime();
+    if (isinf(floatTime))
+        return signbit(floatTime) ? negativeInfiniteTime() : positiveInfiniteTime();
     if (floatTime > numeric_limits<int64_t>::max())
         return positiveInfiniteTime();
     if (floatTime < numeric_limits<int64_t>::min())
@@ -106,8 +99,8 @@ MediaTime MediaTime::createWithDouble(double doubleTime, int32_t timeScale)
 {
     if (doubleTime != doubleTime)
         return invalidTime();
-    if (std::isinf(doubleTime))
-        return std::signbit(doubleTime) ? negativeInfiniteTime() : positiveInfiniteTime();
+    if (isinf(doubleTime))
+        return signbit(doubleTime) ? negativeInfiniteTime() : positiveInfiniteTime();
     if (doubleTime > numeric_limits<int64_t>::max())
         return positiveInfiniteTime();
     if (doubleTime < numeric_limits<int64_t>::min())
index 7fa279fd9c10008ecdd82ff6847eb7a379fc5a72..f1c941c61b91ed5eb66f797f70bc94b543d9e67f 100644 (file)
@@ -1,3 +1,11 @@
+2012-07-27  Jer Noble  <jer.noble@apple.com>
+
+        Unreviewed build fix.
+
+        Wrap MSVC-specific fixes is a COMPILER() check, not a PLATFORM() check.
+
+        * TestWebKitAPI/Tests/WTF/MediaTime.cpp:
+
 2012-07-27  Xianzhu Wang  <wangxianzhu@chromium.org>
 
         [Chromium-Android] NRWT better handling of DRT deadlocks and crashes
index 700fb635f7d231161f3aa17076ffd3c77dc2d75b..574c67d65320bc3d0148119ccc3d472b61f4fcef 100644 (file)
@@ -36,7 +36,7 @@
 
 using namespace std;
 
-#if PLATFORM(WIN)
+#if COMPILER(MSVC)
 // Work around Visual Studio 2008's lack of an INFINITY or NAN definition.
 #include <limits>
 #if !defined(INFINITY)