Commit 2cb0493b authored by Alex Samorukov's avatar Alex Samorukov Committed by Alex Samorukov

Replace finite() with isfinite() by default

This is part of the C standard also also causing warning on macOS.

(cherry picked from commit 04997fc0)
parent 00106b1d
Pipeline #129419 passed with stages
in 30 minutes and 49 seconds
......@@ -31,10 +31,10 @@
#include "gimp-utils.h"
#if defined (HAVE_FINITE)
#define FINITE(x) finite(x)
#elif defined (HAVE_ISFINITE)
#if defined (HAVE_ISFINITE)
#define FINITE(x) isfinite(x)
#elif defined (HAVE_FINITE)
#define FINITE(x) finite(x)
#elif defined (G_OS_WIN32)
#define FINITE(x) _finite(x)
#else
......
......@@ -30,10 +30,10 @@
#include "gimpcurve-map.h"
#if defined (HAVE_FINITE)
#define FINITE(x) finite(x)
#elif defined (HAVE_ISFINITE)
#if defined (HAVE_ISFINITE)
#define FINITE(x) isfinite(x)
#elif defined (HAVE_FINITE)
#define FINITE(x) finite(x)
#elif defined (G_OS_WIN32)
#define FINITE(x) _finite(x)
#else
......
......@@ -1020,7 +1020,7 @@ AC_RUN_IFELSE(
[AC_MSG_RESULT])],
[AC_MSG_RESULT()])
# Check for finite or isfinite
# Check for finite
AC_CHECK_FUNCS(finite, , [
AC_MSG_CHECKING(for finite in <math.h>)
AC_LINK_IFELSE(
......@@ -1029,15 +1029,23 @@ AC_CHECK_FUNCS(finite, , [
[[double f = 0.0; finite (f)]])],
[AC_DEFINE(HAVE_FINITE, 1)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_CHECKING(for isfinite in <math.h>)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>]],
[[float f = 0.0; isfinite(f)]])],
[AC_DEFINE([HAVE_ISFINITE],[1],[Define to 1 if you have the isfinite function.])
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])])])
[AC_MSG_RESULT(no)])
]
)
# Check for isfinite
AC_CHECK_FUNCS(isfinite, , [
AC_MSG_CHECKING(for isfinite in <math.h>)
AC_LINK_IFELSE(
[AC_LANG_PROGRAM(
[[#include <math.h>]],
[[double f = 0.0; isfinite (f)]])],
[AC_DEFINE(HAVE_ISFINITE, 1)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
]
)
AC_SUBST(HAVE_FINITE)
AC_SUBST(HAVE_ISFINITE)
......
......@@ -2888,10 +2888,10 @@ CODE
$extra{app}->{code} = <<'CODE';
#if defined (HAVE_FINITE)
#define FINITE(x) finite(x)
#elif defined (HAVE_ISFINITE)
#if defined (HAVE_ISFINITE)
#define FINITE(x) isfinite(x)
#elif defined (HAVE_FINITE)
#define FINITE(x) finite(x)
#elif defined (G_OS_WIN32)
#define FINITE(x) _finite(x)
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment