summaryrefslogtreecommitdiff
path: root/include/ruby/win32.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 16:34:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-10-23 16:34:22 +0000
commita0c67155a0ef28e02823048e74a5f59e556a22d9 (patch)
tree044c552da72379faddb6510fe8238cd00bb32c34 /include/ruby/win32.h
parent33945edf39c1703a71bed4b022a051bf209518f6 (diff)
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
Diffstat (limited to 'include/ruby/win32.h')
-rw-r--r--include/ruby/win32.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index 979e73b..96b2f3f 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 <float.h>
+
+#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)