tomka 15/03/26 12:44:41 Added: singular-4.0.2-ntl8-compat.patch Log: Fix ntl8 compatibility (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 565C32BC)
Revision Changes Path 1.1 sci-mathematics/singular/files/singular-4.0.2-ntl8-compat.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/singular/files/singular-4.0.2-ntl8-compat.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-mathematics/singular/files/singular-4.0.2-ntl8-compat.patch?rev=1.1&content-type=text/plain Index: singular-4.0.2-ntl8-compat.patch =================================================================== diff --git a/factory/NTLconvert.cc b/factory/NTLconvert.cc index 41ce9b2..e32093d 100644 --- a/factory/NTLconvert.cc +++ b/factory/NTLconvert.cc @@ -30,6 +30,7 @@ #include <NTL/GF2EXFactoring.h> #include <NTL/tools.h> #include <NTL/mat_ZZ.h> +#include <NTL/version.h> #include "int_int.h" #include <limits.h> #include "NTLconvert.h" @@ -500,8 +501,14 @@ convertZZ2CF (const ZZ & a) return CanonicalForm(coeff_long); } else - { - long sizeofrep= ((long *) a.rep) [1]; + { + const long * rep = +#if NTL_MAJOR_VERSION <= 6 + static_cast<long *>( a.rep ); +#else + static_cast<long *>( a.rep.rep ); // what about NTL7? +#endif + long sizeofrep= rep[1]; bool lessZero= false; if (sizeofrep < 0) { @@ -519,7 +526,7 @@ convertZZ2CF (const ZZ & a) cf_stringtemp_l= sizeofrep*sizeof(mp_limb_t)*2; cf_stringtemp= (unsigned char*) Alloc (cf_stringtemp_l); } - int cc= mpn_get_str (cf_stringtemp, 16, (mp_limb_t *) (((long *) (a.rep)) + 2), sizeofrep); + int cc= mpn_get_str (cf_stringtemp, 16, (mp_limb_t *) ((rep) + 2), sizeofrep); char* cf_stringtemp2; if (lessZero)
