Skip to content

Commit a6b8976

Browse files
committed
patch 7.4.1463
Problem: Configure doesn't find isinf() and isnan() on some systems. Solution: Use a configure check that includes math.h.
1 parent 2f6271b commit a6b8976

File tree

3 files changed

+95
-2
lines changed

3 files changed

+95
-2
lines changed

src/auto/configure

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11858,7 +11858,7 @@ for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \
1185811858
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
1185911859
sigvec strcasecmp strerror strftime stricmp strncasecmp \
1186011860
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
11861-
usleep utime utimes isnan isinf
11861+
usleep utime utimes
1186211862
do :
1186311863
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
1186411864
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -12379,6 +12379,70 @@ if ac_fn_c_try_link "$LINENO"; then :
1237912379
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
1238012380
$as_echo "yes" >&6; }; $as_echo "#define HAVE_FLOAT_FUNCS 1" >>confdefs.h
1238112381

12382+
else
12383+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12384+
$as_echo "no" >&6; }
12385+
fi
12386+
rm -f core conftest.err conftest.$ac_objext \
12387+
conftest$ac_exeext conftest.$ac_ext
12388+
12389+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for isinf()" >&5
12390+
$as_echo_n "checking for isinf()... " >&6; }
12391+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12392+
/* end confdefs.h. */
12393+
12394+
#ifdef HAVE_MATH_H
12395+
# include <math.h>
12396+
#endif
12397+
#if STDC_HEADERS
12398+
# include <stdlib.h>
12399+
# include <stddef.h>
12400+
#endif
12401+
12402+
int
12403+
main ()
12404+
{
12405+
int r = isinf(1.11);
12406+
;
12407+
return 0;
12408+
}
12409+
_ACEOF
12410+
if ac_fn_c_try_link "$LINENO"; then :
12411+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12412+
$as_echo "yes" >&6; }; $as_echo "#define HAVE_ISINF 1" >>confdefs.h
12413+
12414+
else
12415+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
12416+
$as_echo "no" >&6; }
12417+
fi
12418+
rm -f core conftest.err conftest.$ac_objext \
12419+
conftest$ac_exeext conftest.$ac_ext
12420+
12421+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for isnan()" >&5
12422+
$as_echo_n "checking for isnan()... " >&6; }
12423+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
12424+
/* end confdefs.h. */
12425+
12426+
#ifdef HAVE_MATH_H
12427+
# include <math.h>
12428+
#endif
12429+
#if STDC_HEADERS
12430+
# include <stdlib.h>
12431+
# include <stddef.h>
12432+
#endif
12433+
12434+
int
12435+
main ()
12436+
{
12437+
int r = isnan(1.11);
12438+
;
12439+
return 0;
12440+
}
12441+
_ACEOF
12442+
if ac_fn_c_try_link "$LINENO"; then :
12443+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
12444+
$as_echo "yes" >&6; }; $as_echo "#define HAVE_ISNAN 1" >>confdefs.h
12445+
1238212446
else
1238312447
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
1238412448
$as_echo "no" >&6; }

src/configure.in

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3565,7 +3565,7 @@ AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
35653565
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
35663566
sigvec strcasecmp strerror strftime stricmp strncasecmp \
35673567
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
3568-
usleep utime utimes isnan isinf)
3568+
usleep utime utimes)
35693569
AC_FUNC_FSEEKO
35703570

35713571
dnl define _LARGE_FILES, _FILE_OFFSET_BITS and _LARGEFILE_SOURCE when
@@ -3668,6 +3668,33 @@ AC_TRY_LINK([
36683668
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_FLOAT_FUNCS),
36693669
AC_MSG_RESULT(no))
36703670

3671+
dnl isinf() and isnan() need to include header files and may need -lm.
3672+
AC_MSG_CHECKING([for isinf()])
3673+
AC_TRY_LINK([
3674+
#ifdef HAVE_MATH_H
3675+
# include <math.h>
3676+
#endif
3677+
#if STDC_HEADERS
3678+
# include <stdlib.h>
3679+
# include <stddef.h>
3680+
#endif
3681+
], [int r = isinf(1.11); ],
3682+
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISINF),
3683+
AC_MSG_RESULT(no))
3684+
3685+
AC_MSG_CHECKING([for isnan()])
3686+
AC_TRY_LINK([
3687+
#ifdef HAVE_MATH_H
3688+
# include <math.h>
3689+
#endif
3690+
#if STDC_HEADERS
3691+
# include <stdlib.h>
3692+
# include <stddef.h>
3693+
#endif
3694+
], [int r = isnan(1.11); ],
3695+
AC_MSG_RESULT(yes); AC_DEFINE(HAVE_ISNAN),
3696+
AC_MSG_RESULT(no))
3697+
36713698
dnl Link with -lposix1e for ACL stuff; if not found, try -lacl for SGI
36723699
dnl when -lacl works, also try to use -lattr (required for Debian).
36733700
dnl On Solaris, use the acl_get/set functions in libsec, if present.

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ static char *(features[]) =
743743

744744
static int included_patches[] =
745745
{ /* Add new patch number below this line */
746+
/**/
747+
1463,
746748
/**/
747749
1462,
748750
/**/

0 commit comments

Comments
 (0)