archrelease: copy trunk to community-any
[ArchLinux/community.git] / freehdl / trunk / build-fix.patch
blob1bc9effedb2db72a4802b6512ff2556ac66f90cd
1 diff -wbBur freehdl-0.0.8/freehdl/kernel-db.hh freehdl-0.0.8.my/freehdl/kernel-db.hh
2 --- freehdl-0.0.8/freehdl/kernel-db.hh 2009-03-15 20:51:51.000000000 +0300
3 +++ freehdl-0.0.8.my/freehdl/kernel-db.hh 2018-11-16 13:52:59.586301664 +0300
4 @@ -254,10 +254,10 @@
6 // A hash function template used tp generate a hash number from
7 // d
8 -class db_basic_key_hash : public hash<unsigned long> {
9 +class db_basic_key_hash : public std::hash<unsigned long> {
10 public:
11 size_t operator()(const db_basic_key& x) const {
12 - return (*(hash<unsigned long> *)this)(((unsigned long)x.value)>>2);
13 + return (*(std::hash<unsigned long> *)this)(((unsigned long)x.value)>>2);
17 diff -wbBur freehdl-0.0.8/freehdl/kernel-util.hh freehdl-0.0.8.my/freehdl/kernel-util.hh
18 --- freehdl-0.0.8/freehdl/kernel-util.hh 2008-02-15 21:30:07.000000000 +0300
19 +++ freehdl-0.0.8.my/freehdl/kernel-util.hh 2018-11-16 13:52:26.466302045 +0300
20 @@ -24,10 +24,10 @@
21 // A hash function template used tp generate a hash number from
22 // pointer values.
23 template<class T>
24 -class pointer_hash : public hash<unsigned long> {
25 +class pointer_hash : public std::hash<unsigned long> {
26 public:
27 size_t operator()(const T& x) const {
28 - return (*(hash<unsigned long> *)this)(((unsigned long)x)>>2);
29 + return (*(std::hash<unsigned long> *)this)(((unsigned long)x)>>2);
33 diff -wbBur freehdl-0.0.8/v2cc/gvhdl.in freehdl-0.0.8.my/v2cc/gvhdl.in
34 --- freehdl-0.0.8/v2cc/gvhdl.in 2011-03-12 16:16:47.000000000 +0300
35 +++ freehdl-0.0.8.my/v2cc/gvhdl.in 2018-11-16 13:48:18.562971561 +0300
36 @@ -9,7 +9,7 @@
37 my $vhdl_source_name = "";
38 my $source = "";
39 my $includes = "";
40 -my $cpplibs = "-lm FREEHDL/lib/libfreehdl-kernel.la FREEHDL/lib/libfreehdl-std.la";
41 +my $cpplibs = "-lm -lfreehdl-kernel -lfreehdl-std";
42 my $vhdl_library = ""; # Library the design entity is compiled into
43 my $cpp_options = "";
44 my $vhdl_options = "";
45 diff -wbBur freehdl-0.0.8/v2cc/gvhdl-local freehdl-0.0.8.my/v2cc/gvhdl-local
46 --- freehdl-0.0.8/v2cc/gvhdl-local 2005-12-02 01:16:20.000000000 +0300
47 +++ freehdl-0.0.8.my/v2cc/gvhdl-local 2018-11-16 13:48:18.562971561 +0300
48 @@ -8,7 +8,7 @@
49 my $vhdl_source_name = "";
50 my $source = "";
51 my $includes = "";
52 -my $cpplibs = "-lm FREEHDL/kernel/libfreehdl-kernel.la FREEHDL/std/libfreehdl-std.la";
53 +my $cpplibs = "-lm -lfreehdl-kernel -lfreehdl-std";
54 my $vhdl_library = ""; # Library the design entity is compiled into
55 my $cpp_options = "-static ";
56 my $vhdl_options = "";
57 diff -wbBur freehdl-0.0.8/v2cc/v2cc-decl.cc freehdl-0.0.8.my/v2cc/v2cc-decl.cc
58 --- freehdl-0.0.8/v2cc/v2cc-decl.cc 2010-05-08 16:15:38.000000000 +0400
59 +++ freehdl-0.0.8.my/v2cc/v2cc-decl.cc 2018-11-16 13:57:39.026298452 +0300
60 @@ -1901,12 +1901,12 @@
61 str += "class " + qid(decl, rstack, INFO) + ":public float_info_base{\n" +
62 "public:\n" +
63 " " + qid(decl, rstack, INFO) + "():float_info_base(" +
64 - to_string(range.left) + ","+ to_string(range.right) + "," +
65 - to_string(min(range.left,range.right)) + "," + to_string(max(range.left, range.right)) + ") {};\n" +
66 - " static floatingpoint low() { return " + to_string(min(range.left, range.right)) + "; }\n" +
67 - " static floatingpoint high() { return " + to_string(max(range.left, range.right)) + "; }\n" +
68 - " static floatingpoint left() { return " + to_string(range.left) + "; }\n" +
69 - " static floatingpoint right() { return " + to_string(range.right) + "; }\n" +
70 + std::to_string(range.left) + ","+ std::to_string(range.right) + "," +
71 + std::to_string(min(range.left,range.right)) + "," + std::to_string(max(range.left, range.right)) + ") {};\n" +
72 + " static floatingpoint low() { return " + std::to_string(min(range.left, range.right)) + "; }\n" +
73 + " static floatingpoint high() { return " + std::to_string(max(range.left, range.right)) + "; }\n" +
74 + " static floatingpoint left() { return " + std::to_string(range.left) + "; }\n" +
75 + " static floatingpoint right() { return " + std::to_string(range.right) + "; }\n" +
76 "};\n";
77 } else {
78 // Integer info class definition with non static bounds (i.e.,
79 diff -wbBur freehdl-0.0.8/v2cc/v2cc-expr.cc freehdl-0.0.8.my/v2cc/v2cc-expr.cc
80 --- freehdl-0.0.8/v2cc/v2cc-expr.cc 2008-02-15 21:13:46.000000000 +0300
81 +++ freehdl-0.0.8.my/v2cc/v2cc-expr.cc 2018-11-16 13:57:59.986298211 +0300
82 @@ -602,7 +602,7 @@
83 else if (ale->value->is(IR_FLOATING_POINT_LITERAL))
84 str += (folded_value(ale).original_string () != "") ?
85 folded_value(ale).original_string () :
86 - to_string (folded_value(ale).double_value ());
87 + std::to_string (folded_value(ale).double_value ());
88 else
89 abort ();
90 } else
91 diff -wbBur freehdl-0.0.8/v2cc/v2cc-util.cc freehdl-0.0.8.my/v2cc/v2cc-util.cc
92 --- freehdl-0.0.8/v2cc/v2cc-util.cc 2009-04-19 02:51:38.000000000 +0400
93 +++ freehdl-0.0.8.my/v2cc/v2cc-util.cc 2018-11-16 13:56:43.602965757 +0300
94 @@ -137,7 +137,7 @@
96 else if (base_type->is (IR_FLOATING_TYPE))
98 - str = to_string (v.double_value ());
99 + str = std::to_string (v.double_value ());
102 return str;
103 @@ -536,7 +536,7 @@
104 if (base_type->is(IR_ENUMERATION_TYPE))
105 str += "enumeration(" + to_string(data.long_value()) + ")";
106 else if (base_type->is(IR_FLOATING_TYPE))
107 - str += to_string(data.double_value());
108 + str += std::to_string(data.double_value());
109 else if (base_type->is(IR_PHYSICAL_TYPE))
110 str += to_string(data.long_value()) + "LL";
111 else if (base_type->is(IR_ARRAY_TYPE))
112 @@ -568,7 +568,7 @@
113 else if (base_type->is(IR_FLOATING_TYPE)) {
114 // Replace 'e' ein the floating point number by 'l' in order to
115 // match the definition of doubles in lisp.
116 - string result = to_string(data.double_value());
117 + string result = std::to_string(data.double_value());
118 for (unsigned int i = 0; i < result.length(); i++)
119 if (result[i] == 'e' ||
120 result[i] == 'E')
121 @@ -1772,8 +1772,8 @@
122 StaticRangeDescriptor<double, IR_Direction> range =
123 range_des_vec[0].rangedes_to_double(rstack);
125 - string left_str = to_string(range.left);
126 - string right_str = to_string(range.right);
127 + string left_str = std::to_string(range.left);
128 + string right_str = std::to_string(range.right);
129 if (!range.valid[1]) {
130 // If the range is not static then do not perform any furhter
131 // checks. All checks will be done at runtime.