Workaround for "Internal compiler error" in 32-bit MSVC (19.29.30037) compiler after dc00f0bf98.

This commit is contained in:
Lukáš Hejl 2022-01-17 12:20:44 +01:00
parent 76abbe97f6
commit 878dce1fdf

View File

@ -422,7 +422,7 @@ static Direction get_shortest_direction(const AvoidCrossingPerimeters::Boundary
} }
// Straighten the travel path as long as it does not collide with the contours stored in edge_grid. // Straighten the travel path as long as it does not collide with the contours stored in edge_grid.
static std::vector<TravelPoint> simplify_travel(const AvoidCrossingPerimeters::Boundary &boundary, const std::vector<TravelPoint> &travel) static std::vector<TravelPoint> simplify_travel(const AvoidCrossingPerimeters::Boundary &boundary, std::vector<TravelPoint> &travel)
{ {
FirstIntersectionVisitor visitor(boundary.grid); FirstIntersectionVisitor visitor(boundary.grid);
std::vector<TravelPoint> simplified_path; std::vector<TravelPoint> simplified_path;
@ -439,7 +439,15 @@ static std::vector<TravelPoint> simplify_travel(const AvoidCrossingPerimeters::B
visitor.pt_current = &current_point; visitor.pt_current = &current_point;
if (!next.do_not_remove) if (!next.do_not_remove)
for (size_t point_idx_2 = point_idx + 1; point_idx_2 < travel.size() && !travel[point_idx_2].do_not_remove; ++point_idx_2) { for (size_t point_idx_2 = point_idx + 1; point_idx_2 < travel.size(); ++point_idx_2) {
// Workaround for some issue in MSVC 19.29.30037 32-bit compiler.
#if defined(_WIN32) && !defined(_WIN64)
if (bool volatile do_not_remove = travel[point_idx_2].do_not_remove; do_not_remove)
break;
#else
if (travel[point_idx_2].do_not_remove)
break;
#endif
if (travel[point_idx_2].point == current_point) { if (travel[point_idx_2].point == current_point) {
next = travel[point_idx_2]; next = travel[point_idx_2];
point_idx = point_idx_2; point_idx = point_idx_2;