sagemath/sagemath-ntl.patch
2015-12-22 12:50:40 -02:00

56 lines
2.4 KiB
Diff

NTL 8.x introduces a new class, NTL::WrappedPtr<T>. Unfortunately, Cython
does not add a namespace identifier to the name of the existing WrappedPtr
class, generated from the patched files below, resulting in ambiguous
references to that name. This patch simply changes the name of the existing
class to avoid the name collision.
diff -up src/sage/libs/polybori/decl.pxd.orig src/sage/libs/polybori/decl.pxd
--- src/sage/libs/polybori/decl.pxd.orig 2015-10-11 18:10:28.994844062 -0300
+++ src/sage/libs/polybori/decl.pxd 2015-10-11 18:11:16.004845863 -0300
@@ -289,10 +289,10 @@ cdef extern from "sage/libs/polybori/pb_
int (* size)()
PBPolyEntry (* get "operator[]")(int)
- ctypedef struct PBFglmStrategy "PBWrappedPtr<FGLMStrategy>":
+ ctypedef struct PBFglmStrategy "WrappedPointer<FGLMStrategy>":
PBPolyVector (* main "operator->()->main")()
- PBFglmStrategy PBFglmStrategy_Constructor "PBWrappedPtr<FGLMStrategy>" \
+ PBFglmStrategy PBFglmStrategy_Constructor "WrappedPointer<FGLMStrategy>" \
(PBRing from_ring, PBRing to_ring, PBPolyVector vec)
cdef cppclass PBGBStrategy "GroebnerStrategy":
diff -up src/sage/libs/polybori/pb_wrap.h.orig src/sage/libs/polybori/pb_wrap.h
--- src/sage/libs/polybori/pb_wrap.h.orig 2015-10-11 18:10:35.738844321 -0300
+++ src/sage/libs/polybori/pb_wrap.h 2015-10-11 18:12:42.724849183 -0300
@@ -177,23 +177,23 @@ PyObject* preallocated_to_PyString(const
template <class Type>
-class PBWrappedPtr:
+class WrappedPointer:
public boost::shared_ptr<Type> {
- typedef PBWrappedPtr self;
+ typedef WrappedPointer self;
typedef boost::shared_ptr<Type> base;
public:
- PBWrappedPtr(): base() {}
- PBWrappedPtr(const self& rhs): base(rhs) {}
+ WrappedPointer(): base() {}
+ WrappedPointer(const self& rhs): base(rhs) {}
template <class T1>
- PBWrappedPtr(const T1& arg): base(new Type(arg)) {}
+ WrappedPointer(const T1& arg): base(new Type(arg)) {}
template <class T1, class T2>
- PBWrappedPtr(const T1& arg1, const T2& arg2): base(new Type(arg1, arg2)) {}
+ WrappedPointer(const T1& arg1, const T2& arg2): base(new Type(arg1, arg2)) {}
template <class T1, class T2, class T3>
- PBWrappedPtr(const T1& arg1, const T2& arg2, const T3& arg3):
+ WrappedPointer(const T1& arg1, const T2& arg2, const T3& arg3):
base(new Type(arg1, arg2, arg3)) {}
operator Type&() { return base::operator*();}