diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-12-05 21:47:25 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-12-05 21:47:25 +0000 |
commit | 61873a59d7f7e2a3ef58af6efe594eb8228a86ec (patch) | |
tree | c12337ad8a0eedaa605291a74b1494f2b2c228d9 | |
parent | d230e3e532dbb0df39453375f9918608d1e71b54 (diff) |
add sk_float_isfinite to mask platform differences
git-svn-id: http://skia.googlecode.com/svn/trunk@2803 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | include/core/SkFloatingPoint.h | 8 | ||||
-rw-r--r-- | tests/ScalarTest.cpp | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/include/core/SkFloatingPoint.h b/include/core/SkFloatingPoint.h index ece577abd2..30cd770959 100644 --- a/include/core/SkFloatingPoint.h +++ b/include/core/SkFloatingPoint.h @@ -58,7 +58,7 @@ static inline float sk_float_copysign(float x, float y) { #define sk_float_acos(x) acosf(x) #define sk_float_asin(x) asinf(x) #endif - #define sk_float_atan2(y,x) atan2f(y,x) + #define sk_float_atan2(y,x) atan2f(y,x) #define sk_float_abs(x) fabsf(x) #define sk_float_mod(x,y) fmodf(x,y) #define sk_float_exp(x) expf(x) @@ -66,6 +66,12 @@ static inline float sk_float_copysign(float x, float y) { #define sk_float_isNaN(x) _isnan(x) #endif +#ifdef SK_BUILD_FOR_WIN + #define sk_float_isfinite(x) _finite(x) +#else + #define sk_float_isfinite(x) isfinite(x) +#endif + #ifdef SK_USE_FLOATBITS #define sk_float_floor2int(x) SkFloatToIntFloor(x) #define sk_float_round2int(x) SkFloatToIntRound(x) diff --git a/tests/ScalarTest.cpp b/tests/ScalarTest.cpp index 2848516b97..6c2df73199 100644 --- a/tests/ScalarTest.cpp +++ b/tests/ScalarTest.cpp @@ -20,7 +20,7 @@ static bool isFinite_int(float x) { } static bool isFinite_float(float x) { - return isfinite(x); + return sk_float_isfinite(x); } static bool isFinite_mulzero(float x) { |