Skip to content

Commit d3f5bd6

Browse files
committed
Fix CLang compiler errors
1 parent e68a9f8 commit d3f5bd6

File tree

6 files changed

+741
-619
lines changed

6 files changed

+741
-619
lines changed

.github/workflows/builds.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,13 @@ jobs:
9393
./bootstrap.sh
9494
./b2 headers
9595
working-directory: boost
96+
- name: Bootstrap patches
97+
shell: sh
98+
run: |
99+
patch -s -p0 < read.patch
100+
patch -s -p0 < polygon_45_set_data.patch
101+
patch -s -p0 < rational.patch
102+
patch -s -p0 < boolean_op_45.patch
96103
- name: Compile godot-cpp
97104
shell: sh
98105
run: |

boolean_op_45.patch

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
--- boost/libs/polygon/include/boost/polygon/detail/boolean_op_45.hpp 2024-07-31 23:46:08.633941157 +0300
2+
+++ boost/libs/polygon/include/boost/polygon/detail/boolean_op_45.hpp.modified 2024-07-31 23:36:42.118430273 +0300
3+
@@ -816,7 +816,6 @@
4+
//the cross point is not on the integer grid and cannot be represented
5+
//we must throw an exception
6+
std::string msg = "GTL 45 Boolean error, precision insufficient to represent edge intersection coordinate value.";
7+
- throw(msg);
8+
} else {
9+
//note that result of this subtraction is always positive because itr1 is above itr2 in scanline
10+
LongUnit halfDelta2 = (LongUnit)((((LongUnit)y1) - y2)/2);

polygon_45_set_data.patch

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
--- boost/libs/polygon/include/boost/polygon/polygon_45_set_data.hpp 2024-07-31 23:49:08.016048498 +0300
2+
+++ boost/libs/polygon/include/boost/polygon/polygon_45_set_data.hpp.modified 2024-07-31 23:36:20.069293631 +0300
3+
@@ -1578,9 +1578,10 @@
4+
} else {
5+
sort();
6+
rvalue.sort();
7+
- try {
8+
+ if constexpr (true) {
9+
result.is_manhattan_ = applyBoolean45OpOnVectors<Unit, op>(result.data_, data_, rvalue.data_);
10+
- } catch (std::string str) {
11+
+ } else {
12+
+ std::string str;
13+
std::string msg = "GTL 45 Boolean error, precision insufficient to represent edge intersection coordinate value.";
14+
if(str == msg) {
15+
result.clear();
16+
@@ -1659,7 +1660,7 @@
17+
result.is_manhattan_ = result_is_manhattan;
18+
result.dirty_ = false;
19+
result.unsorted_ = false;
20+
- } else { throw str; }
21+
+ } else { }
22+
}
23+
//std::cout << "DONE SCANNING\n";
24+
}
25+
@@ -1699,9 +1700,10 @@
26+
result.unsorted_ = false;
27+
} else {
28+
sort();
29+
- try {
30+
+ if constexpr (true) {
31+
result.is_manhattan_ = applyUnary45OpOnVectors<Unit, op>(result.data_, data_);
32+
- } catch (std::string str) {
33+
+ } else {
34+
+ std::string str;
35+
std::string msg = "GTL 45 Boolean error, precision insufficient to represent edge intersection coordinate value.";
36+
if(str == msg) {
37+
result.clear();
38+
@@ -1770,7 +1772,7 @@
39+
result.is_manhattan_ = result_is_manhattan;
40+
result.dirty_ = false;
41+
result.unsorted_ = false;
42+
- } else { throw str; }
43+
+ } else { }
44+
}
45+
//std::cout << "DONE SCANNING\n";
46+
}

rational.patch

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--- boost/libs/rational/include/boost/rational.hpp 2024-07-31 23:49:25.025152763 +0300
2+
+++ boost/libs/rational/include/boost/rational.hpp.modified 2024-07-31 23:53:04.925500721 +0300
3+
@@ -946,15 +946,15 @@
4+
if ( c == '/' )
5+
{
6+
if ( is >> std::noskipws >> d )
7+
- try {
8+
+ { if constexpr (true) {
9+
r.assign( n, d );
10+
- } catch ( bad_rational & ) { // normalization fail
11+
- try { is.setstate(ios::failbit); }
12+
- catch ( ... ) {} // don't throw ios_base::failure...
13+
+ } else { // normalization fail
14+
+ if (true) { is.setstate(ios::failbit); }
15+
+ else {} // don't throw ios_base::failure...
16+
if ( is.exceptions() & ios::failbit )
17+
- throw; // ...but the original exception instead
18+
+ (void) 0; // ...but the original exception instead
19+
// ELSE: suppress the exception, use just error flags
20+
- }
21+
+ } }
22+
}
23+
else
24+
is.setstate( ios::failbit );

read.patch

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
--- boost/libs/geometry/include/boost/geometry/io/wkt/read.hpp 2024-07-31 23:49:44.507272188 +0300
2+
+++ boost/libs/geometry/include/boost/geometry/io/wkt/read.hpp.modified 2024-07-31 23:37:17.314648387 +0300
3+
@@ -137,7 +137,6 @@
4+
// Stop at end of tokens, or at "," ot ")"
5+
bool finished = (it == end || *it == "," || *it == ")");
6+
7+
- try
8+
{
9+
// Initialize missing coordinates to default constructor (zero)
10+
// OR
11+
@@ -149,18 +148,6 @@
12+
? coordinate_type()
13+
: coordinate_cast<coordinate_type>::apply(*it));
14+
}
15+
- catch(boost::bad_lexical_cast const& blc)
16+
- {
17+
- BOOST_THROW_EXCEPTION(read_wkt_exception(blc.what(), it, end, wkt));
18+
- }
19+
- catch(std::exception const& e)
20+
- {
21+
- BOOST_THROW_EXCEPTION(read_wkt_exception(e.what(), it, end, wkt));
22+
- }
23+
- catch(...)
24+
- {
25+
- BOOST_THROW_EXCEPTION(read_wkt_exception("", it, end, wkt));
26+
- }
27+
28+
parsing_assigner<Point, Dimension + 1, DimensionCount>::apply(
29+
(finished ? it : ++it), end, point, wkt);

0 commit comments

Comments
 (0)