summaryrefslogtreecommitdiff
path: root/debian/patches/fix_ftbfs_cannot_find_infinite.patch
blob: 97b915b57177e2a87ecdbdd4c1be358c56567b34 (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
Description: This patch fixes an FTBFS due to std::infinite not
 available
Author: Ruben Undheim <ruben.undheim@gmail.com>
Bug-Debian: https://bugs.debian.org/822408

Index: yosys/frontends/ast/ast.cc
===================================================================
--- yosys.orig/frontends/ast/ast.cc
+++ yosys/frontends/ast/ast.cc
@@ -857,11 +857,7 @@ RTLIL::Const AstNode::realAsConst(int wi
 {
 	double v = round(realvalue);
 	RTLIL::Const result;
-#ifdef EMSCRIPTEN
 	if (!isfinite(v)) {
-#else
-	if (!std::isfinite(v)) {
-#endif
 		result.bits = std::vector<RTLIL::State>(width, RTLIL::State::Sx);
 	} else {
 		bool is_negative = v < 0;
Index: yosys/passes/cmds/qwp.cc
===================================================================
--- yosys.orig/passes/cmds/qwp.cc
+++ yosys/passes/cmds/qwp.cc
@@ -19,6 +19,7 @@
 
 #include "kernel/yosys.h"
 #include "kernel/sigtools.h"
+#include <math.h>
 
 #undef LOG_MATRICES
 #undef PYPLOT_EDGES
@@ -341,7 +342,7 @@ struct QwpWorker
 			double c = alt_mode ? alt_midpos : midpos;
 			double r = alt_mode ? alt_radius : radius;
 
-			if (std::isfinite(v)) {
+			if (isfinite(v)) {
 				v = min(v, c+r);
 				v = max(v, c-r);
 			} else {
@@ -523,14 +524,14 @@ struct QwpWorker
 			double rel_pos = node.pos - median;
 			if (rel_pos < 0) {
 				node.pos = midpos + left_scale*rel_pos;
-				if (std::isfinite(node.pos)) {
+				if (isfinite(node.pos)) {
 					node.pos = min(node.pos, midpos);
 					node.pos = max(node.pos, midpos - radius);
 				} else
 					node.pos = midpos - radius/2;
 			} else {
 				node.pos = midpos + right_scale*rel_pos;
-				if (std::isfinite(node.pos)) {
+				if (isfinite(node.pos)) {
 					node.pos = max(node.pos, midpos);
 					node.pos = min(node.pos, midpos + radius);
 				} else