1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-31 21:57:12 +00:00
freebsd-ports/math/gnuplot+/files/patch-za
Steve Price d80572ef73 o Fix Configuration Option for readline library
o Add patch to avoid divide-by-zero trap
o Merge patches for gnuplot-3.7.1

PR:		16120
Submitted by:	Akio Morita <amorita@meadow.scphys.kyoto-u.ac.jp>
Reviewed by:	maintainer
2000-01-24 06:19:03 +00:00

75 lines
1.5 KiB
Plaintext

--- gplt_x11.c.ORIG Thu Dec 2 17:02:05 1999
+++ gplt_x11.c Thu Dec 2 17:02:54 1999
@@ -169,6 +169,10 @@
# define EINTR E_ILLFNC
#endif
+#ifdef __FreeBSD__
+# include <floatingpoint.h>
+#endif
+
/* information about one window/plot */
typedef struct plot_struct {
@@ -301,6 +305,10 @@
int argc;
char *argv[];
{
+#ifdef __FreeBSD__
+ /* allow divide by zero -- Inf */
+ fpsetmask(fpgetmask() & ~(FP_X_DZ | FP_X_INV));
+#endif
#ifndef X11ORG
setlocale(LC_ALL, "");
@@ -335,6 +343,12 @@
}
}
XCloseDisplay(dpy);
+
+#ifdef __FreeBSD__
+ fpresetsticky(FP_X_DZ | FP_X_INV);
+ fpsetmask(fpgetmask() | (FP_X_DZ | FP_X_INV));
+#endif
+
FPRINTF((stderr, "exiting\n"));
--- plot.c.ORIG Thu Dec 2 17:02:05 1999
+++ plot.c Thu Dec 2 17:02:54 1999
@@ -73,6 +73,10 @@
# endif
#endif /* _Windows */
+#ifdef __FreeBSD__
+# include <floatingpoint.h>
+#endif
+
extern FILE *gpoutfile;
TBOOLEAN interactive = TRUE; /* FALSE if stdin not a terminal */
@@ -347,6 +351,11 @@
_control87(MCW_EM, MCW_EM);
#endif
+#ifdef __FreeBSD__
+ /* allow divide by zero -- Inf */
+ fpsetmask(fpgetmask() & ~(FP_X_DZ | FP_X_INV));
+#endif
+
#if defined(OS2)
int rc;
if (_osmode == OS2_MODE) {
@@ -565,6 +574,11 @@
#ifdef OS2
if (_osmode == OS2_MODE)
RexxDeregisterSubcom("GNUPLOT", NULL);
+#endif
+
+#ifdef __FreeBSD__
+ fpresetsticky(FP_X_DZ | FP_X_INV);
+ fpsetmask(fpgetmask() | (FP_X_DZ | FP_X_INV));
#endif
#if defined(ATARI) || defined(MTOS)