]> O.S.I.I.S - jp/vkvg.git/commitdiff
replace obsolete isnanf by isnan
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 18 Feb 2022 20:05:22 +0000 (21:05 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 18 Feb 2022 22:00:14 +0000 (23:00 +0100)
src/cross_os.h
src/vkvg_context_internal.c

index 32f05f0436449ecce8f90313013c7b8e9aa8f466..e2d4350af48a6fd944c3f13798672afef78a3aca 100644 (file)
        //disable warning on iostream functions on windows
        #define _CRT_SECURE_NO_WARNINGS
        #include "windows.h"
-       #if defined(_WIN32)
-               #define isnanf isnan
-       #else
-               #ifndef isnanf
-                       #define isnanf _isnanf
+       #if defined(_WIN64)
+               #ifndef isnan
+                       #define isnan _isnanf
                #endif
        #endif
        #define vkvg_inline __forceinline
@@ -39,7 +37,6 @@
        #define reset_warning (warn)
 #elif __APPLE__
        #include <math.h>
-       #define isnanf isnan
        #define vkvg_inline static
        #define disable_warning (warn)
        #define reset_warning (warn)
@@ -47,9 +44,6 @@
        #include <unistd.h>
        #include <sys/types.h>
        #include <pwd.h>
-       #ifndef isnanf
-               #define isnanf __isnanf
-       #endif
        #define vkvg_inline static inline __attribute((always_inline))
        #define disable_warning (warn) #pragma GCC diagnostic ignored "-W"#warn
        #define reset_warning (warn) #pragma GCC diagnostic warning "-W"#warn
index b1bd258b052fb244ad64c11cf38a50ca978ebcfd..7ab182a836f69ad8d99ec3a127a06185763559ce 100644 (file)
@@ -221,7 +221,7 @@ bool _path_is_closed (VkvgContext ctx, uint32_t ptrPath){
 void _add_point (VkvgContext ctx, float x, float y){
        if (_check_point_array(ctx))
                return;
-       if (isnanf(x) || isnanf(y)) {
+       if (isnan(x) || isnan(y)) {
                LOG(VKVG_LOG_DEBUG, "_add_point: (%f, %f)\n", x, y);
                return;
        }
@@ -1484,7 +1484,7 @@ void _elliptic_arc (VkvgContext ctx, float x1, float y1, float x2, float y2, boo
        vec2 u = vec2_unit_x;
        vec2 v = {(p1.x-cp.x)/rx, (p1.y-cp.y)/ry};
        double sa = acosf (vec2_dot (u, v) / (fabsf(vec2_length(v)) * fabsf(vec2_length(u))));
-       if (isnanf(sa))
+       if (isnan(sa))
                sa=M_PIF;
        if (u.x*v.y-u.y*v.x < 0)
                sa = -sa;
@@ -1492,7 +1492,7 @@ void _elliptic_arc (VkvgContext ctx, float x1, float y1, float x2, float y2, boo
        u = v;
        v = (vec2) {(-p1.x-cp.x)/rx, (-p1.y-cp.y)/ry};
        double delta_theta = acosf (vec2_dot (u, v) / (fabsf(vec2_length (v)) * fabsf(vec2_length (u))));
-       if (isnanf(delta_theta))
+       if (isnan(delta_theta))
                delta_theta=M_PIF;
        if (u.x*v.y-u.y*v.x < 0)
                delta_theta = -delta_theta;