From 4270dbe629600ac7ab72da3fecd13ba7af234a51 Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 31 Jul 2011 14:17:40 +0000 Subject: Forward-ports r32777 from branches/ruby_1_9_3 to trunk. -- * complex.c (f_signbit): gcc4 on Solaris DOES have signbit but does not have it on header. * math.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ complex.c | 3 +++ math.c | 4 ++++ 3 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8288383ff1..e36ae56968 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Jul 31 21:16:02 2011 Yuki Sonoda (Yugui) + + * complex.c (f_signbit): gcc4 on Solaris DOES have signbit but does + not have it on header. + + * math.c: ditto. + Sun Jul 31 21:09:04 2011 Yuki Sonoda (Yugui) * common.mk (node_name.inc): Use $(Q) for consistency. diff --git a/complex.c b/complex.c index 78f0902a83..a21249681f 100644 --- a/complex.c +++ b/complex.c @@ -1173,6 +1173,9 @@ nucomp_eql_p(VALUE self, VALUE other) inline static VALUE f_signbit(VALUE x) { +#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun__) + extern int signbit(double x); +#endif switch (TYPE(x)) { case T_FLOAT: { double f = RFLOAT_VALUE(x); diff --git a/math.c b/math.c index b3ac188d94..98b327272b 100644 --- a/math.c +++ b/math.c @@ -14,6 +14,10 @@ #include #include +#if defined(HAVE_SIGNBIT) && defined(__GNUC__) && defined(__sun__) + extern int signbit(double x); +#endif + #define numberof(array) (int)(sizeof(array) / sizeof((array)[0])) VALUE rb_mMath; -- cgit v1.2.3