diff --git a/ChangeLog b/ChangeLog index 3fb941d818..e0cba8eb81 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 24 01:34:12 2013 Nobuyoshi Nakada + + * include/ruby/win32.h (rb_infinity_float): suppress overflow in + constant arithmetic warnings. [ruby-core:57981] [Bug #9044] + Thu Oct 24 00:11:24 2013 Marc-Andre Lafortune * lib/ostruct.rb: raise NoMethodError with a #name and #args. diff --git a/include/ruby/win32.h b/include/ruby/win32.h index 979e73b2d3..96b2f3f8a2 100644 --- a/include/ruby/win32.h +++ b/include/ruby/win32.h @@ -355,6 +355,20 @@ extern FILE *rb_w32_fsopen(const char *, const char *, int); #endif #include + +#if defined _MSC_VER && _MSC_VER >= 1800 && defined INFINITY +#pragma warning(push) +#pragma warning(disable:4756) +static inline float +rb_infinity_float(void) +{ + return INFINITY; +} +#pragma warning(pop) +#undef INFINITY +#define INFINITY rb_infinity_float() +#endif + #if !defined __MINGW32__ || defined __NO_ISOCEXT #ifndef isnan #define isnan(x) _isnan(x)