diff options
Diffstat (limited to 'math/algae/patches/patch-aa')
-rw-r--r-- | math/algae/patches/patch-aa | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/math/algae/patches/patch-aa b/math/algae/patches/patch-aa new file mode 100644 index 00000000000..7d4774df678 --- /dev/null +++ b/math/algae/patches/patch-aa @@ -0,0 +1,45 @@ +$NetBSD: patch-aa,v 1.1.1.1 2002/05/04 01:10:03 jtb Exp $ + +--- /dev/null Tue Jan 2 02:09:36 2001 ++++ fpe/netbsd1.5.c +@@ -0,0 +1,40 @@ ++#if HAVE_CONFIG_H ++#include <config.h> ++#endif ++ ++#include <stdio.h> ++#include <math.h> ++#include <errno.h> ++#include <ieeefp.h> ++#include <setjmp.h> ++#include <signal.h> ++ ++#if !SKIP_LOCAL_INCLUDES ++#include "exception.h" ++#include "message.h" ++#endif ++ ++static void ++catch_sigfpe (int sig, int code, struct sigcontext *scp) ++{ ++ fail ("Floating point exception."); ++ raise_exception (); ++} ++ ++void ++enable_fpe_traps () ++{ ++ struct sigaction act; ++ ++ act.sa_handler = (void (*)(int)) catch_sigfpe; ++ sigemptyset (&act.sa_mask); ++ act.sa_flags = 0; ++ ++ if (sigaction (SIGFPE, &act, NULL)) ++ wipeout ("Bad sigaction call."); ++ ++ sigaddset (&act.sa_mask, SIGFPE); ++ sigprocmask (SIG_UNBLOCK, &act.sa_mask, NULL); ++ ++ fpsetmask (FP_X_INV | FP_X_DZ | FP_X_OFL); ++} |