diff options
-rw-r--r-- | php/src/IcePHP/Types.cpp | 7 | ||||
-rw-r--r-- | python/modules/IcePy/Types.cpp | 7 | ||||
-rw-r--r-- | ruby/src/IceRuby/Types.cpp | 8 |
3 files changed, 19 insertions, 3 deletions
diff --git a/php/src/IcePHP/Types.cpp b/php/src/IcePHP/Types.cpp index 4f93205442e..94b7cfd4e2a 100644 --- a/php/src/IcePHP/Types.cpp +++ b/php/src/IcePHP/Types.cpp @@ -759,7 +759,12 @@ IcePHP::PrimitiveInfo::validate(zval* zv TSRMLS_DC) if(Z_TYPE_P(zv) == IS_DOUBLE) { double val = Z_DVAL_P(zv); - return (val <= numeric_limits<float>::max() && val >= -numeric_limits<float>::max()) || !isfinite(val); + return (val <= numeric_limits<float>::max() && val >= -numeric_limits<float>::max()) || +#if defined(_MSC_VER) && (_MSC_VER <= 1700) + !_finite(val); +#else + !isfinite(val); +#endif } break; } diff --git a/python/modules/IcePy/Types.cpp b/python/modules/IcePy/Types.cpp index 37e9db0d9e3..151d400757a 100644 --- a/python/modules/IcePy/Types.cpp +++ b/python/modules/IcePy/Types.cpp @@ -726,7 +726,12 @@ IcePy::PrimitiveInfo::validate(PyObject* p) { // Ensure double does not exceed maximum float value before casting double val = PyFloat_AsDouble(p); - return (val <= numeric_limits<float>::max() && val >= -numeric_limits<float>::max()) || !isfinite(val); + return (val <= numeric_limits<float>::max() && val >= -numeric_limits<float>::max()) || +#if defined(_MSC_VER) && (_MSC_VER <= 1700) + !_finite(val); +#else + !isfinite(val); +#endif } break; diff --git a/ruby/src/IceRuby/Types.cpp b/ruby/src/IceRuby/Types.cpp index 8ca6e29cffa..4834320d1e2 100644 --- a/ruby/src/IceRuby/Types.cpp +++ b/ruby/src/IceRuby/Types.cpp @@ -597,7 +597,13 @@ IceRuby::PrimitiveInfo::marshal(VALUE p, const Ice::OutputStreamPtr& os, ObjectM } assert(TYPE(val) == T_FLOAT); double d = static_cast<double>(RFLOAT_VALUE(val)); - if(isfinite(d) && (d > numeric_limits<float>::max() || d < -numeric_limits<float>::max())) + if( +#if defined(_MSC_VER) && (_MSC_VER <= 1700) + _finite(val) && +#else + isfinite(d) && +#endif + (d > numeric_limits<float>::max() || d < -numeric_limits<float>::max())) { throw RubyException(rb_eTypeError, "value is out of range for a float"); } |