From a0c67155a0ef28e02823048e74a5f59e556a22d9 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 23 Oct 2013 16:34:22 +0000 Subject: [PATCH] win32.h: suppress INFINITY warnings * include/ruby/win32.h (rb_infinity_float): suppress overflow in constant arithmetic warnings. [ruby-core:57981] [Bug #9044] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ include/ruby/win32.h | 14 ++++++++++++++ 2 files changed, 19 insertions(+) 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)