[SCM] Debian packaging for libntl - Number Theory Library branch, master, updated. 495cd20eddfb2e1e749eb6154e3d536c3b7a1506
Felix Salfelder
salfelder at em.cs.uni-frankfurt.de
Thu Jan 26 20:37:07 UTC 2012
The following commit has been merged in the master branch:
commit 495cd20eddfb2e1e749eb6154e3d536c3b7a1506
Author: Felix Salfelder <salfelder at em.cs.uni-frankfurt.de>
Date: Thu Jan 26 21:34:21 2012 +0100
a callback for sage (from sage-4.7.tar/spkg/ntl/dist/debian)
diff --git a/debian/patches/sage_error_callback.patch b/debian/patches/sage_error_callback.patch
new file mode 100644
index 0000000..fdaf6d6
--- /dev/null
+++ b/debian/patches/sage_error_callback.patch
@@ -0,0 +1,53 @@
+--- a/src/tools.c
++++ b/src/tools.c
+@@ -18,8 +18,35 @@
+ void (*ErrorCallback)() = 0;
+
+
++/*
++ The following code differs from vanilla NTL 5.4.2.
++
++ We add a SetErrorCallbackFunction(). This sets a global callback function _function_,
++ which gets called with parameter _context_ and an error message string whenever Error()
++ gets called.
++
++ Note that if the custom error handler *returns*, then NTL will dump the error message
++ back to stderr and abort() as it habitually does.
++
++ -- David Harvey (2008-04-12)
++*/
++
++void (*ErrorCallbackFunction)(const char*, void*) = NULL;
++void *ErrorCallbackContext = NULL;
++
++
++void SetErrorCallbackFunction(void (*function)(const char*, void*), void *context)
++{
++ ErrorCallbackFunction = function;
++ ErrorCallbackContext = context;
++}
++
++
+ void Error(const char *s)
+ {
++ if (ErrorCallbackFunction != NULL)
++ ErrorCallbackFunction(s, ErrorCallbackContext);
++
+ cerr << s << "\n";
+ _ntl_abort();
+ }
+--- a/include/NTL/tools.h
++++ b/include/NTL/tools.h
+@@ -252,6 +252,12 @@
+ char IntValToChar(long a);
+
+
++/*
++ This function is not present in vanilla NTL 5.4.2.
++ See tools.c for documentation.
++ */
++void SetErrorCallbackFunction(void (*func)(const char *s, void *context), void *context);
++
+
+ void Error(const char *s);
+
diff --git a/debian/patches/series b/debian/patches/series
index 2996f55..fb0bcfa 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,6 @@
0001-gcc-4.5-mips.patch
0002-mach_desc.patch
+
+# this patch is for sage.
+sage_error_callback.patch
+
--
Debian packaging for libntl - Number Theory Library
More information about the debian-science-commits
mailing list