|
| 1 | +From 502cf86d0bb2a96715be6764774b64a69c1ca34c Mon Sep 17 00:00:00 2001 |
| 2 | +From: Hans Schoenemann < [email protected]> |
| 3 | +Date: Wed, 25 Jul 2018 11:03:32 +0200 |
| 4 | +Subject: [PATCH] move error handler for factory,NTL to the non-libSingular part |
| 5 | + |
| 6 | +(see forum: "NTL error handling", for SAGE) |
| 7 | + |
| 8 | +diff --git a/Singular/cntrlc.cc b/Singular/cntrlc.cc |
| 9 | +index 622495490c..874a5deb79 100644 |
| 10 | +--- a/Singular/cntrlc.cc |
| 11 | ++++ b/Singular/cntrlc.cc |
| 12 | +@@ -20,6 +20,14 @@ |
| 13 | + #include "Singular/links/silink.h" |
| 14 | + #include "Singular/links/ssiLink.h" |
| 15 | + |
| 16 | ++#ifdef HAVE_NTL |
| 17 | ++#include <NTL/version.h> |
| 18 | ++#include <NTL/tools.h> |
| 19 | ++#ifdef NTL_CLIENT |
| 20 | ++NTL_CLIENT |
| 21 | ++#endif |
| 22 | ++#endif |
| 23 | ++ |
| 24 | + /* undef, if you don't want GDB to come up on error */ |
| 25 | + |
| 26 | + #define CALL_GDB |
| 27 | +@@ -549,11 +557,20 @@ static void stack_trace (char *const*args) |
| 28 | + |
| 29 | + # endif /* !__OPTIMIZE__ */ |
| 30 | + |
| 31 | +-/*2 |
| 32 | +-* init signal handlers |
| 33 | +-*/ |
| 34 | ++/// init signal handlers and error handling for libraries: NTL, factory |
| 35 | + void init_signals() |
| 36 | + { |
| 37 | ++// NTL error handling (>= 9.3.0) ---------------------------------------- |
| 38 | ++#ifdef HAVE_NTL |
| 39 | ++#if (((NTL_MAJOR_VERSION==9)&&(NTL_MINOR_VERSION>=3))||(NTL_MAJOR_VERSION>=10)) |
| 40 | ++ ErrorMsgCallback=WerrorS; |
| 41 | ++ ErrorCallback=HALT; |
| 42 | ++#endif |
| 43 | ++#endif |
| 44 | ++// factory error handling: ----------------------------------------------- |
| 45 | ++ factoryError=WerrorS; |
| 46 | ++ |
| 47 | ++// signal handler ------------------------------------------------------- |
| 48 | + #ifdef SIGSEGV |
| 49 | + si_set_signal(SIGSEGV,(si_hdl_typ)sigsegv_handler); |
| 50 | + #endif |
| 51 | +diff --git a/Singular/misc_ip.cc b/Singular/misc_ip.cc |
| 52 | +index 49eddaae6f..3d5775edd7 100644 |
| 53 | +--- a/Singular/misc_ip.cc |
| 54 | ++++ b/Singular/misc_ip.cc |
| 55 | +@@ -1316,16 +1316,6 @@ static BOOLEAN iiCrossProd(leftv res, leftv args) |
| 56 | + On(SW_USE_EZGCD_P); |
| 57 | + On(SW_USE_QGCD); |
| 58 | + Off(SW_USE_NTL_SORT); // may be changed by an command line option |
| 59 | +- factoryError=WerrorS; |
| 60 | +- |
| 61 | +-// NTL error handling (>= 9.3.0) |
| 62 | +-#ifdef HAVE_NTL |
| 63 | +-#if (((NTL_MAJOR_VERSION==9)&&(NTL_MINOR_VERSION>=3))||(NTL_MAJOR_VERSION>=10)) |
| 64 | +- ErrorMsgCallback=WerrorS; |
| 65 | +- ErrorCallback=HALT; |
| 66 | +-#endif |
| 67 | +-#endif |
| 68 | +- |
| 69 | + // memory initialization: ----------------------------------------------- |
| 70 | + om_Opts.OutOfMemoryFunc = omSingOutOfMemoryFunc; |
| 71 | + #ifndef OM_NDEBUG |
0 commit comments