Skip to content

Commit

Permalink
Trac #27263: Upgrade to giac 1.5 fails to build with older libstdc++
Browse files Browse the repository at this point in the history
#26315 broke building giac on some systems that have a old-ish
libstdc++.  It is completely mysterious to me ''why'' this broke when it
worked before, and without a repository it's very difficult to determine
what change between the versions is responsible, as there is little
difference between the two versions in the relevant code.

Nevertheless, it can be fixed by explicitly using `std::isnan` and
`std::isinf` so that there is no risk of them conflicting with the libc
math.h equivalents thereof.

URL: https://trac.sagemath.org/27263
Reported by: embray
Ticket author(s): Erik Bray
Reviewer(s): Dima Pasechnik
  • Loading branch information
Release Manager authored and vbraun committed Feb 13, 2019
2 parents 714748d + 2651e20 commit 6772ac9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions build/pkgs/giac/patches/isnan-conflict.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Just always use std::isnan and std::isinf so there is no risk of
conflicting with the libc math.h equivalents thereof.

See https://trac.sagemath.org/ticket/27263
--- a/src/global.cc 2019-02-12 15:49:03.082594000 +0000
+++ b/src/global.cc 2019-02-12 15:49:43.438594000 +0000
@@ -4139,11 +4139,7 @@
return isnan(d);
#endif
#else
-#if defined(FIR_LINUX) || defined(FIR_ANDROID)
return std::isnan(d);
-#else
- return isnan(d);
-#endif
#endif
}

@@ -4152,11 +4148,7 @@
double x=0.0;
return d==1.0/x || d==-1.0/x;
#else
-#if defined(FIR_LINUX) || defined(FIR_ANDROID)
return std::isinf(d);
-#else
- return isinf(d);
-#endif
#endif
}

0 comments on commit 6772ac9

Please sign in to comment.