Ecore: use isfinite() if available
Use isfinite() if available, otherwise use finite() on compilers != vc++, otherwise use _finite() and a bit of formatting too (i know, it's bad) SVN revision: 58566
This commit is contained in:
parent
963f6d1721
commit
239dca689b
|
@ -1001,34 +1001,56 @@ AC_ISC_POSIX
|
|||
AC_FUNC_ALLOCA
|
||||
AC_CHECK_FUNCS(gettimeofday strlcpy)
|
||||
|
||||
have_atfile_source=auto
|
||||
AC_ARG_ENABLE(atfile-source,
|
||||
AC_HELP_STRING([--disable-atfile-source],
|
||||
[disable use of atfile source functions as openat and mkdirat @<:@default=detect@:>@]),
|
||||
[have_atfile_source=$enableval], [have_atfile_source=auto])
|
||||
AC_COMPILE_IFELSE(
|
||||
[AC_LANG_PROGRAM(
|
||||
[[
|
||||
#include <math.h>
|
||||
]],
|
||||
[[
|
||||
int i = isfinite(0);
|
||||
]])],
|
||||
[
|
||||
AC_DEFINE(HAVE_ISFINITE, 1, [Define to 1 if you have `isfinite', as a function or macro.])
|
||||
have_isfinite="yes"
|
||||
],
|
||||
[have_isfinite="no"])
|
||||
|
||||
if test "x$have_atfile_source" != "xno"; then
|
||||
AC_CHECK_FUNCS(mkdirat,
|
||||
[
|
||||
have_atfile_source=yes
|
||||
AC_DEFINE(HAVE_ATFILE_SOURCE, 1, [mkdirat exists])
|
||||
],
|
||||
[
|
||||
if test "x$have_atfile_source" = "xyes"; then
|
||||
AC_MSG_ERROR([required atfile-source but no mkdirat()])
|
||||
fi
|
||||
have_atfile_source=no
|
||||
])
|
||||
AC_MSG_CHECKING([for isfinite])
|
||||
AC_MSG_RESULT([${have_isfinite}])
|
||||
|
||||
have_atfile_source=auto
|
||||
AC_ARG_ENABLE([atfile-source],
|
||||
[AC_HELP_STRING([--disable-atfile-source],
|
||||
[disable use of atfile source functions as openat and mkdirat @<:@default=detect@:>@])],
|
||||
[
|
||||
if test "x${enableval}" = "xyes" ; then
|
||||
have_atfile_source="yes"
|
||||
else
|
||||
have_atfile_source="no"
|
||||
fi],
|
||||
[have_atfile_source=auto])
|
||||
|
||||
if ! test "x${have_atfile_source}" = "xno" ; then
|
||||
AC_CHECK_FUNCS(mkdirat,
|
||||
[
|
||||
have_atfile_source="yes"
|
||||
AC_DEFINE(HAVE_ATFILE_SOURCE, 1, [mkdirat exists])
|
||||
],
|
||||
[
|
||||
if test "x${have_atfile_source}" = "xyes" ; then
|
||||
AC_MSG_ERROR([required atfile-source but no mkdirat()])
|
||||
fi
|
||||
have_atfile_source="no"
|
||||
])
|
||||
fi
|
||||
|
||||
### Checks for optionnal feature
|
||||
AC_CHECK_FUNC(mallinfo,
|
||||
[
|
||||
have_mallinfo=yes
|
||||
AC_DEFINE(HAVE_MALLINFO, 1, [Gather memory statistic])
|
||||
], [
|
||||
have_mallinfo=no
|
||||
])
|
||||
AC_CHECK_FUNC([mallinfo],
|
||||
[
|
||||
have_mallinfo="yes"
|
||||
AC_DEFINE(HAVE_MALLINFO, 1, [Gather memory statistic])
|
||||
],
|
||||
[have_mallinfo="no"])
|
||||
|
||||
### Ecore modules
|
||||
|
||||
|
|
|
@ -30,6 +30,16 @@
|
|||
# include <float.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ISFINITE
|
||||
# define ECORE_FINITE(t) isfinite(t)
|
||||
#else
|
||||
# ifdef _MSC_VER
|
||||
# define ECORE_FINITE(t) _finite(t)
|
||||
# else
|
||||
# define ECORE_FINITE(t) finite(t)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#define FIX_HZ 1
|
||||
|
||||
#ifdef FIX_HZ
|
||||
|
@ -1079,7 +1089,7 @@ _ecore_main_select(double timeout)
|
|||
#endif
|
||||
|
||||
t = NULL;
|
||||
if ((!finite(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */
|
||||
if ((!ECORE_FINITE(timeout)) || (timeout == 0.0)) /* finite() tests for NaN, too big, too small, and infinity. */
|
||||
{
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
|
Loading…
Reference in New Issue