aboutsummaryrefslogtreecommitdiffstats
path: root/testing/dia/isfinite.patch
blob: 796d4fda8c7499240d09279788640186abcf1ae4 (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
diff --git a/lib/arrows.c b/lib/arrows.c
index 4371946..389ef58 100644
--- a/lib/arrows.c
+++ b/lib/arrows.c
@@ -18,7 +18,7 @@
 
 #include <config.h>
 
-#define _BSD_SOURCE 1 /* to get finite */
+#define _GNU_SOURCE 1 /* to get isfinite */
 #include <math.h>
 #include <stdio.h>
 #include <string.h>
@@ -29,11 +28,7 @@
 
 #ifdef G_OS_WIN32
 #include <float.h>
-#define finite(d) _finite(d)
-#endif
-
-#ifdef __EMX__
-#define finite(d) isfinite(d)
+#define isfinite(d) _finite(d)
 #endif
 
 #include "arrows.h"
@@ -421,7 +416,7 @@ draw_one_exactly(DiaRenderer *renderer, Point *to, Point *from,
   else {
     vl.x = 1.0; vl.y = 0.0;
   }
-  if (!finite(vl.x)) {
+  if (!isfinite(vl.x)) {
     vl.x = 1.0; vl.y = 0.0;
   }
   point_get_perp(&vt,&vl);
@@ -498,7 +493,7 @@ draw_one_or_none(DiaRenderer *renderer, Point *to, Point *from,
   else {
     vl.x = 1.0; vl.y = 0.0;
   }
-  if (!finite(vl.x)) {
+  if (!isfinite(vl.x)) {
     vl.x = 1.0; vl.y = 0.0;
   }
   point_get_perp(&vt,&vl);
@@ -610,7 +605,7 @@ draw_fill_ellipse(DiaRenderer *renderer, Point *to, Point *from,
   else {
     vl.x = 1.0; vl.y = 0.0;
   }
-  if (!finite(vl.x)) {
+  if (!isfinite(vl.x)) {
     vl.x = 1.0; vl.y = 0.0;
   }
   point_get_perp(&vt,&vl);
@@ -672,7 +667,7 @@ draw_empty_ellipse(DiaRenderer *renderer, Point *to, Point *from,
   else {
     vl.x = 1.0; vl.y = 0.0;
   }
-  if (!finite(vl.x)) {
+  if (!isfinite(vl.x)) {
     vl.x = 1.0; vl.y = 0.0;
   }
 
@@ -718,7 +713,7 @@ calculate_box (Point *poly, const Point *to, const Point *from,
   else {
     vl.x = 1.0; vl.y = 0.0;
   }
-  if (!finite(vl.x)) {
+  if (!isfinite(vl.x)) {
     vl.x = 1.0; vl.y = 0.0;
   }
   point_get_perp(&vt,&vl);
@@ -832,7 +827,7 @@ draw_fill_dot(DiaRenderer *renderer, Point *to, Point *from,
   else {
     vl.x = 1.0; vl.y = 0.0;
   }
-  if (!finite(vl.x)) {
+  if (!isfinite(vl.x)) {
     vl.x = 1.0; vl.y = 0.0;
   }
   point_get_perp(&vt,&vl);
@@ -908,7 +903,7 @@ draw_integral(DiaRenderer *renderer, Point *to, Point *from,
   else {
     vl.x = 1.0; vl.y = 0.0;
   }
-  if (!finite(vl.x)) {
+  if (!isfinite(vl.x)) {
     vl.x = 1.0; vl.y = 0.0;
   }
   point_get_perp(&vt,&vl);
@@ -946,7 +941,7 @@ calculate_slashed (Point *poly, const Point *to, const Point *from,
   else {
     vl.x = 1.0; vl.y = 0.0;
   }
-  if (!finite(vl.x)) {
+  if (!isfinite(vl.x)) {
     vl.x = 1.0; vl.y = 0.0;
   }
   point_get_perp(&vt,&vl);
diff --git a/lib/boundingbox.c b/lib/boundingbox.c
index 6d2749f..c589334 100644
--- a/lib/boundingbox.c
+++ b/lib/boundingbox.c
@@ -21,7 +21,7 @@
 
 #include <config.h>
 
-#define _BSD_SOURCE 1
+#define _GNU_SOURCE 1	/* to get isfinite */
 #include <math.h>
 #include <string.h> /* memcmp() */
 
@@ -510,7 +509,7 @@ polybezier_bbox(const BezPoint *pts, int numpoints,
         real overshoot;
         Point vovs,pto;
 
-	if (finite(alpha))
+	if (isfinite(alpha))
 	  overshoot = extra->middle_trans / sin(alpha/2.0);
 	else /* prependicular? */
 	  overshoot = extra->middle_trans;