freebsd-ports/math/gnuplot+/files/patch-za
Edwin Groothuis 4982d9a25d Fix patch-file.
Noticed by: SANETO Takanori <sanewo@ba2.so-net.ne.jp>
2004-07-17 01:57:52 +00:00

75 lines
1.6 KiB
Plaintext

--- gplt_x11.c.orig Wed May 7 14:21:25 2003
+++ gplt_x11.c Wed May 7 14:55:22 2003
@@ -169,6 +169,10 @@
# define EINTR E_ILLFNC
#endif
+#if defined(__FreeBSD__) && defined(__i386__)
+# include <floatingpoint.h>
+#endif
+
/* information about one window/plot */
typedef struct plot_struct {
@@ -301,6 +305,10 @@
int argc;
char *argv[];
{
+#if defined(__FreeBSD__) && defined(__i386__)
+ /* 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);
+
+#if defined(__FreeBSD__) && defined(__i386__)
+ fpresetsticky(FP_X_DZ | FP_X_INV);
+ fpsetmask(fpgetmask() | (FP_X_DZ | FP_X_INV));
+#endif
+
FPRINTF((stderr, "exiting\n"));
--- plot.c.orig Wed May 7 14:21:25 2003
+++ plot.c Wed May 7 14:45:09 2003
@@ -73,6 +73,10 @@
# endif
#endif /* _Windows */
+#if defined(__FreeBSD__) && defined(__i386__)
+# 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
+#if defined(__FreeBSD__) && defined(__i386__)
+ /* 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
+
+#if defined(__FreeBSD__) && defined(__i386__)
+ fpresetsticky(FP_X_DZ | FP_X_INV);
+ fpsetmask(fpgetmask() | (FP_X_DZ | FP_X_INV));
#endif
#if defined(ATARI) || defined(MTOS)