Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #27713: Include patch to pynac to fix build issue when using Cyg…
Browse files Browse the repository at this point in the history
…win's system GMP
  • Loading branch information
embray committed Apr 23, 2019
1 parent 5ba5a5a commit 5816c4b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/pkgs/pynac/package-version.txt
@@ -1 +1 @@
0.7.24
0.7.24.p0
@@ -0,0 +1,52 @@
From 260f754cf7e421a41e89f3b93fb86a99a05cc376 Mon Sep 17 00:00:00 2001
From: "Erik M. Bray" <erik.bray@lri.fr>
Date: Mon, 22 Apr 2019 16:07:17 +0200
Subject: [PATCH] Fix compliation error with GMP long long limbs.

Depending how GMP is configured the macro from flint, slong, which actually
refers to GMP's mp_limb_signed_t, may be a long long instead of plain long.

numeric doesn't have a constructor for long long, leading to an ambiguous
overload error on the constructor. In this case it should make more sense
to just use normal int and long types for these loop variables as it
makes sense to, and only cast to the "slong" type when passing to the
flint interface.
---
ginac/useries.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ginac/useries.cpp b/ginac/useries.cpp
index 1dc97f0..fd68d49 100644
--- a/ginac/useries.cpp
+++ b/ginac/useries.cpp
@@ -82,10 +82,10 @@ long fmpq_poly_ldegree(const fmpq_poly_t& fp)
if (fmpq_poly_is_zero(fp))
return 0;
long len = fmpq_poly_length(fp);
- for (slong n=0; n<=len; n++) {
+ for (long n=0; n<=len; n++) {
fmpq_t c;
fmpq_init(c);
- fmpq_poly_get_coeff_fmpq(c, fp, n);
+ fmpq_poly_get_coeff_fmpq(c, fp, (slong)n);
if (not fmpq_is_zero(c)) {
fmpq_clear(c);
return n;
@@ -435,12 +435,12 @@ ex useries(const ex& the_ex, const symbol& x, int order, unsigned options)
}

// Fill expair vector
- for (slong n=0; n<=deg+prec; n++) {
+ for (int n=0; n<=deg+prec; n++) {
if (n + fp.offset >= order)
break;
fmpq_t c;
fmpq_init(c);
- fmpq_poly_get_coeff_fmpq(c, fp.ft, n);
+ fmpq_poly_get_coeff_fmpq(c, fp.ft, (slong)n);
if (not fmpq_is_zero(c)) {
mpq_t gc;
mpq_init(gc);
--
2.15.1

0 comments on commit 5816c4b

Please sign in to comment.