Adapt to the NTL 9.3 way of setting an error callback.

This commit is contained in:
Jerry James 2015-09-25 13:53:44 -06:00
parent a7336abef2
commit 4a9ef37508

View file

@ -1,3 +1,48 @@
--- ./src/c_lib/include/ntl_wrap.h.orig 2015-02-16 17:15:08.000000000 -0700
+++ ./src/c_lib/include/ntl_wrap.h 2015-09-25 13:51:18.989444339 -0600
@@ -35,7 +35,7 @@ using namespace NTL;
EXTERN void del_charstar(char*);
-EXTERN void setup_NTL_error_callback(void (*function)(const char*, void*), void* context);
+EXTERN void setup_NTL_error_callback(void (*function)(const char*));
//////// ZZ //////////
--- ./src/c_lib/src/ntl_wrap.cpp.orig 2015-02-16 17:15:08.000000000 -0700
+++ ./src/c_lib/src/ntl_wrap.cpp 2015-09-25 13:49:54.636142928 -0600
@@ -12,9 +12,9 @@ void del_charstar(char* a) {
}
-void setup_NTL_error_callback(void (*function)(const char*, void*), void* context)
+void setup_NTL_error_callback(void (*function)(const char*))
{
- NTL::SetErrorCallbackFunction(function, context);
+ NTL::ErrorMsgCallback = function;
}
--- ./src/c_lib/src/stdsage.c.orig 2015-02-16 17:15:08.000000000 -0700
+++ ./src/c_lib/src/stdsage.c 2015-09-25 13:50:22.081963425 -0600
@@ -36,7 +36,7 @@ void init_global_empty_tuple(void) {
We raise a RuntimeError and then call sig_error() such that the
exception will be seen by sig_on().
*/
-void global_NTL_error_callback(const char* s, void* context)
+void global_NTL_error_callback(const char* s)
{
PyErr_SetString(PyExc_RuntimeError, s);
sig_error();
@@ -49,7 +49,7 @@ void init_csage() {
init_global_empty_tuple();
init_memory_functions();
setup_sage_signal_handler();
- setup_NTL_error_callback(global_NTL_error_callback, NULL);
+ setup_NTL_error_callback(global_NTL_error_callback);
}
/* This is called once for every single module that links in stdsage */
--- ./src/sage/rings/bernmm/bernmm-test.cpp.orig 2015-02-16 17:15:12.000000000 -0700 --- ./src/sage/rings/bernmm/bernmm-test.cpp.orig 2015-02-16 17:15:12.000000000 -0700
+++ ./src/sage/rings/bernmm/bernmm-test.cpp 2015-05-07 21:39:58.565251320 -0600 +++ ./src/sage/rings/bernmm/bernmm-test.cpp 2015-05-07 21:39:58.565251320 -0600
@@ -70,7 +70,7 @@ void bern_naive(mpq_t* res, long n) @@ -70,7 +70,7 @@ void bern_naive(mpq_t* res, long n)