summaryrefslogtreecommitdiff
path: root/math/gnuplot+/files/patch-za
blob: 143d34abc0d45509109af0dced981705ef1f188c (plain) (blame)
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
69
70
71
72
73
74
--- 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)