lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Further GUB failure


From: Masamichi HOSODA
Subject: Re: Further GUB failure
Date: Sun, 23 Aug 2015 23:49:07 +0900 (JST)

> I'm now getting this error:
> 
> /home/gub/NewGub/gub/target/darwin-ppc/src/lilypond-git.sv.gnu.org--
> lilypond.git-release-unstable/flower/offset.cc:43:25: error: 'isinf' was not
> declared in this scope
>    if (!isinf (z2[Y_AXIS]))
>                          ^
> 
> It looks like the compiler cannot find isinf, and possibly this patch is 
> guilty:
> 
> http://code.google.com/p/lilypond/issues/detail?id=4550

I've reproduced it on my Cygwin64 gcc-4.9.3 environment.
Attached patch can be fixed it.
>From 5d4af6d8ad286dce49e65af14f8c008f59dd36d5 Mon Sep 17 00:00:00 2001
From: Masamichi Hosoda <address@hidden>
Date: Sun, 23 Aug 2015 23:47:37 +0900
Subject: [PATCH] Fix Issue 4550: Add "std::" to isinf() and isnan()

gcc 4.9.x needs "std::" to isinf() and isnan().
---
 flower/offset.cc | 16 ++++++++--------
 lily/bezier.cc   |  4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/flower/offset.cc b/flower/offset.cc
index 2fc9bf9..8c476ee 100644
--- a/flower/offset.cc
+++ b/flower/offset.cc
@@ -40,7 +40,7 @@ Offset
 complex_multiply (Offset z1, Offset z2)
 {
   Offset z;
-  if (!isinf (z2[Y_AXIS]))
+  if (!std::isinf (z2[Y_AXIS]))
     {
       z[X_AXIS] = z1[X_AXIS] * z2[X_AXIS] - z1[Y_AXIS] * z2[Y_AXIS];
       z[Y_AXIS] = z1[X_AXIS] * z2[Y_AXIS] + z1[Y_AXIS] * z2[X_AXIS];
@@ -98,22 +98,22 @@ Offset::length () const
 bool
 Offset::is_sane () const
 {
-  return !isnan (coordinate_a_[X_AXIS])
-         && !isnan (coordinate_a_ [Y_AXIS])
-         && !isinf (coordinate_a_[X_AXIS])
-         && !isinf (coordinate_a_[Y_AXIS]);
+  return !std::isnan (coordinate_a_[X_AXIS])
+         && !std::isnan (coordinate_a_ [Y_AXIS])
+         && !std::isinf (coordinate_a_[X_AXIS])
+         && !std::isinf (coordinate_a_[Y_AXIS]);
 }
 
 Offset
 Offset::direction () const
 {
   Offset d = *this;
-  if (isinf (d[X_AXIS]))
+  if (std::isinf (d[X_AXIS]))
     {
-      if (!isinf (d[Y_AXIS]))
+      if (!std::isinf (d[Y_AXIS]))
         return Offset ((d[X_AXIS] > 0.0 ? 1.0 : -1.0), 0.0);
     }
-  else if (isinf (d[Y_AXIS]))
+  else if (std::isinf (d[Y_AXIS]))
     return Offset (0.0, (d[Y_AXIS] > 0.0 ? 1.0 : -1.0));
   else if (d[X_AXIS] == 0.0 && d[Y_AXIS] == 0.0)
     return d;
diff --git a/lily/bezier.cc b/lily/bezier.cc
index e2c099b..daa2673 100644
--- a/lily/bezier.cc
+++ b/lily/bezier.cc
@@ -342,8 +342,8 @@ void
 Bezier::assert_sanity () const
 {
   for (int i = 0; i < CONTROL_COUNT; i++)
-    assert (!isnan (control_[i].length ())
-            && !isinf (control_[i].length ()));
+    assert (!std::isnan (control_[i].length ())
+            && !std::isinf (control_[i].length ()));
 }
 
 void
-- 
2.4.5


reply via email to

[Prev in Thread] Current Thread [Next in Thread]