Commit 04997fc0 authored by Alex Samorukov's avatar Alex Samorukov

Replace finite() with isfinite() by default

This is part of the C standard also also causing warning on macOS.
parent 4cd23c64
Pipeline #129418 passed with stages
in 14 minutes and 21 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
......
......@@ -1021,7 +1021,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(
......@@ -1030,15 +1030,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)
......@@ -1340,7 +1348,7 @@ AC_MSG_CHECKING([whether symbols are prefixed])
case "$host_os" in
mingw*)
case "$host_cpu" in
case "$host_cpu" in
x86_64) SYMPREFIX='' ;;
*) SYMPREFIX='_' ;;
esac
......
......@@ -3106,10 +3106,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