ruby/missing.h: M_PI fallback definition
* include/ruby/missing.h (M_PI, M_PI_2): fallback definitions for VC6. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6f869a57fe
commit
42e36319bd
@ -5,12 +5,12 @@
|
|||||||
which is written in ruby.
|
which is written in ruby.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "internal.h"
|
|
||||||
#if defined _MSC_VER
|
#if defined _MSC_VER
|
||||||
/* Microsoft Visual C does not define M_PI and others by default */
|
/* Microsoft Visual C does not define M_PI and others by default */
|
||||||
# define _USE_MATH_DEFINES 1
|
# define _USE_MATH_DEFINES 1
|
||||||
#endif
|
#endif
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -37,6 +37,13 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
#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
|
#ifndef RUBY_SYMBOL_EXPORT_BEGIN
|
||||||
# define RUBY_SYMBOL_EXPORT_BEGIN /* begin */
|
# define RUBY_SYMBOL_EXPORT_BEGIN /* begin */
|
||||||
# define RUBY_SYMBOL_EXPORT_END /* end */
|
# define RUBY_SYMBOL_EXPORT_END /* end */
|
||||||
|
3
math.c
3
math.c
@ -106,9 +106,6 @@ num2dbl_with_to_f(VALUE num)
|
|||||||
static VALUE
|
static VALUE
|
||||||
math_atan2(VALUE obj, VALUE y, VALUE x)
|
math_atan2(VALUE obj, VALUE y, VALUE x)
|
||||||
{
|
{
|
||||||
#ifndef M_PI
|
|
||||||
# define M_PI 3.14159265358979323846
|
|
||||||
#endif
|
|
||||||
double dx, dy;
|
double dx, dy;
|
||||||
dx = Get_Double(x);
|
dx = Get_Double(x);
|
||||||
dy = Get_Double(y);
|
dy = Get_Double(y);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user