[前][次][番号順一覧][スレッド一覧]

ruby-changes:31329

From: nobu <ko1@a...>
Date: Thu, 24 Oct 2013 01:34:33 +0900 (JST)
Subject: [ruby-changes:31329] nobu:r43408 (trunk): win32.h: suppress INFINITY warnings

nobu	2013-10-24 01:34:22 +0900 (Thu, 24 Oct 2013)

  New Revision: 43408

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43408

  Log:
    win32.h: suppress INFINITY warnings
    
    * include/ruby/win32.h (rb_infinity_float): suppress overflow in
      constant arithmetic warnings.  [ruby-core:57981] [Bug #9044]

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/win32.h
Index: include/ruby/win32.h
===================================================================
--- include/ruby/win32.h	(revision 43407)
+++ include/ruby/win32.h	(revision 43408)
@@ -355,6 +355,20 @@ extern FILE *rb_w32_fsopen(const char *, https://github.com/ruby/ruby/blob/trunk/include/ruby/win32.h#L355
 #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)
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43407)
+++ ChangeLog	(revision 43408)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Oct 24 01:34:12 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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  <ruby-core@m...>
 
 	* lib/ostruct.rb: raise NoMethodError with a #name and #args.

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]