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

ruby-changes:39232

From: nobu <ko1@a...>
Date: Tue, 21 Jul 2015 19:51:47 +0900 (JST)
Subject: [ruby-changes:39232] nobu:r51313 (trunk): ruby/missing.h: M_PI fallback definition

nobu	2015-07-21 19:51:40 +0900 (Tue, 21 Jul 2015)

  New Revision: 51313

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

  Log:
    ruby/missing.h: M_PI fallback definition
    
    * include/ruby/missing.h (M_PI, M_PI_2): fallback definitions for
      VC6.

  Modified files:
    trunk/complex.c
    trunk/include/ruby/missing.h
    trunk/math.c
Index: complex.c
===================================================================
--- complex.c	(revision 51312)
+++ complex.c	(revision 51313)
@@ -5,12 +5,12 @@ https://github.com/ruby/ruby/blob/trunk/complex.c#L5
   which is written in ruby.
 */
 
-#include "internal.h"
 #if defined _MSC_VER
 /* Microsoft Visual C does not define M_PI and others by default */
 # define _USE_MATH_DEFINES 1
 #endif
 #include <math.h>
+#include "internal.h"
 
 #define NDEBUG
 #include <assert.h>
Index: math.c
===================================================================
--- math.c	(revision 51312)
+++ math.c	(revision 51313)
@@ -106,9 +106,6 @@ num2dbl_with_to_f(VALUE num) https://github.com/ruby/ruby/blob/trunk/math.c#L106
 static VALUE
 math_atan2(VALUE obj, VALUE y, VALUE x)
 {
-#ifndef M_PI
-# define M_PI 3.14159265358979323846
-#endif
     double dx, dy;
     dx = Get_Double(x);
     dy = Get_Double(y);
Index: include/ruby/missing.h
===================================================================
--- include/ruby/missing.h	(revision 51312)
+++ include/ruby/missing.h	(revision 51313)
@@ -37,6 +37,13 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/missing.h#L37
 #endif
 #endif
 
+#ifndef M_PI
+# define M_PI 3.14159265358979323846
+#endif
+#ifndef M_PI_2
+# define M_PI_2 (M_PI/2)
+#endif
+
 #ifndef RUBY_SYMBOL_EXPORT_BEGIN
 # define RUBY_SYMBOL_EXPORT_BEGIN /* begin */
 # define RUBY_SYMBOL_EXPORT_END   /* end */

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

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