fontforge / libspiro

Spiro is the creation of Raph Levien. It simplifies the drawing of beautiful curves. (Migrated here from libspiro.sourceforge.net on 2013-04-20)
GNU General Public License v3.0
107 stars 25 forks source link

'finite' is deprecated #24

Closed MaddTheSane closed 4 years ago

MaddTheSane commented 4 years ago

When compiling on OS X, it reports a deprecation warning:

../spiro.c:896:11: warning: 'finite' is deprecated: first deprecated in macOS 10.9 - Use `isfinite((double)x)` instead.
      [-Wdeprecated-declarations]
            if ( IS_FINITE( segs[i].ks[j])==0 ) return -1;

The comment for finite says what should be done:

Legacy BSD API; use the C99 isfinite( ) macro instead.

Looks like the HAVE_FINITE macro detection needs to be tweaked for OS X.

JoesCat commented 4 years ago

It was only 2015 I was answering a question about MIPs, while an older BSD still required finite().

I'll switch the definition around so infinite() appears first, then finite()

JoesCat commented 4 years ago

@MaddTheSane, would you mind testing latest patches?

MaddTheSane commented 4 years ago

Tested, compiles fine. No deprecated warnings.