File: upstream-backport-ntl-error-handler.patch

package info (click to toggle)
singular 1:4.1.1-p2+ds-3
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 35,860 kB
  • sloc: cpp: 288,280; ansic: 17,387; lisp: 4,242; yacc: 1,654; python: 1,608; makefile: 1,424; lex: 1,387; perl: 632; sh: 567; xml: 182
file content (68 lines) | stat: -rw-r--r-- 1,874 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Description: backport: NTL error handler
 Move error handler for factory,NTL to the non-libSingular part.
 (See forum: "NTL error handling", for SAGE).
Comment: Singular commit: 502cf86d0b
Origin: upstream
Author: Hans Schoenemann <hannes@mathematik.uni-kl.de>
Last-Update: 2018-10-06

--- a/Singular/cntrlc.cc
+++ b/Singular/cntrlc.cc
@@ -20,6 +20,14 @@
 #include "Singular/links/silink.h"
 #include "Singular/links/ssiLink.h"
 
+#ifdef HAVE_NTL
+#include <NTL/version.h>
+#include <NTL/tools.h>
+#ifdef NTL_CLIENT
+NTL_CLIENT
+#endif
+#endif
+
 /* undef, if you don't want GDB to come up on error */
 
 #define CALL_GDB
@@ -549,11 +557,20 @@
 
 #  endif /* !__OPTIMIZE__ */
 
-/*2
-* init signal handlers
-*/
+/// init signal handlers and error handling for libraries: NTL, factory
 void init_signals()
 {
+// NTL error handling (>= 9.3.0) ----------------------------------------
+#ifdef HAVE_NTL
+#if (((NTL_MAJOR_VERSION==9)&&(NTL_MINOR_VERSION>=3))||(NTL_MAJOR_VERSION>=10))
+  ErrorMsgCallback=WerrorS;
+  ErrorCallback=HALT;
+#endif
+#endif
+// factory error handling: -----------------------------------------------
+  factoryError=WerrorS;
+
+// signal handler -------------------------------------------------------
   #ifdef SIGSEGV
   si_set_signal(SIGSEGV,(si_hdl_typ)sigsegv_handler);
   #endif
--- a/Singular/misc_ip.cc
+++ b/Singular/misc_ip.cc
@@ -1316,16 +1316,6 @@
   On(SW_USE_EZGCD_P);
   On(SW_USE_QGCD);
   Off(SW_USE_NTL_SORT); // may be changed by an command line option
-  factoryError=WerrorS;
-
-// NTL error handling (>= 9.3.0)
-#ifdef HAVE_NTL
-#if (((NTL_MAJOR_VERSION==9)&&(NTL_MINOR_VERSION>=3))||(NTL_MAJOR_VERSION>=10))
-  ErrorMsgCallback=WerrorS;
-  ErrorCallback=HALT;
-#endif
-#endif
-
 // memory initialization: -----------------------------------------------
     om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc;
 #ifndef OM_NDEBUG