33#ifndef __PATH_CONVERTERS_H__
44#define __PATH_CONVERTERS_H__
55
6+ #include < cmath>
67#include " agg_path_storage.h"
78#include " agg_clip_liang_barsky.h"
8- #include " MPL_isnan.h"
99#include " mplutils.h"
1010#include " agg_conv_segmentator.h"
1111
@@ -176,14 +176,14 @@ class PathNanRemover : protected EmbeddedQueue<4>
176176 }
177177
178178 size_t num_extra_points = num_extra_points_map[code & 0xF ];
179- bool has_nan = (MPL_notisfinite64 ( *x) || MPL_notisfinite64 (*y));
179+ bool has_nan = (!( std::isfinite ( *x) && std::isfinite (*y) ));
180180 queue_push (code, *x, *y);
181181
182182 /* Note: this test can not be short-circuited, since we need to
183183 advance through the entire curve no matter what */
184184 for (size_t i = 0 ; i < num_extra_points; ++i) {
185185 m_source->vertex (x, y);
186- has_nan = has_nan || ( MPL_notisfinite64 (*x) || MPL_notisfinite64 (*y));
186+ has_nan = has_nan || !( std::isfinite (*x) && std::isfinite (*y));
187187 queue_push (code, *x, *y);
188188 }
189189
@@ -196,7 +196,7 @@ class PathNanRemover : protected EmbeddedQueue<4>
196196 /* If the last point is finite, we use that for the
197197 moveto, otherwise, we'll use the first vertex of
198198 the next curve. */
199- if (!( MPL_notisfinite64 ( *x) || MPL_notisfinite64 (*y) )) {
199+ if (std::isfinite ( *x) && std::isfinite (*y)) {
200200 queue_push (agg::path_cmd_move_to, *x, *y);
201201 needs_move_to = false ;
202202 } else {
@@ -219,14 +219,14 @@ class PathNanRemover : protected EmbeddedQueue<4>
219219 return code;
220220 }
221221
222- if (MPL_notisfinite64 ( *x) || MPL_notisfinite64 (*y)) {
222+ if (!( std::isfinite ( *x) && std::isfinite (*y) )) {
223223 do {
224224 code = m_source->vertex (x, y);
225225 if (code == agg::path_cmd_stop ||
226226 code == (agg::path_cmd_end_poly | agg::path_flags_close)) {
227227 return code;
228228 }
229- } while (MPL_notisfinite64 ( *x) || MPL_notisfinite64 (*y));
229+ } while (!( std::isfinite ( *x) && std::isfinite (*y) ));
230230 return agg::path_cmd_move_to;
231231 }
232232
0 commit comments