On Sat, 9 Apr 2011, David Seikel wrote:
> On Thu, 7 Apr 2011 16:40:46 +0200 (CEST) Vincent Torri > <vto...@univ-evry.fr> wrote: > >> >> >> On Fri, 8 Apr 2011, David Seikel wrote: >> >>> Ecore uses a call to finite(), this call seems to be obsolete. It >>> is replaced by a macro isfinite(). I'm wondering if we should fix >>> that, and what our portability experts think? >>> >>> It's used in _ecore_main_select() in ecore_main.c. I don't think >>> it is used anywhere else in current svn. >>> >>> In my current contract I'm compiling EFL using uClibc, and that does >>> not provide finite(), but does provide isfinite(). The reason they >>> say they do that is coz finite() is obsolete. >>> >>> Hmm, the Windows build files include this "finite=_finite" in >>> "PreprocessorDefinitions". Seems to be basically renaming a few >>> functions to their Windows equivalents. >> >> If there are such problems in different libc, I would suggest to >> detect the function in configure.ac and add a static inline function >> that used the corresponding function, with a special case for Visul >> Studio (_finite(), no finite(), nor isfinite() nor _isfinite() (I >> just checked)) > > Static inline? Why not a macro? isfinite() is supposed to be a macro > for what it's worth. like the path below ? Index: src/lib/ecore/ecore_main.c =================================================================== --- src/lib/ecore/ecore_main.c (revision 58562) +++ src/lib/ecore/ecore_main.c (working copy) @@ -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 @@ #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; Index: configure.ac =================================================================== --- configure.ac (revision 58562) +++ configure.ac (working copy) @@ -1001,34 +1001,56 @@ AC_FUNC_ALLOCA AC_CHECK_FUNCS(gettimeofday strlcpy) +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"]) + +AC_MSG_CHECKING([for isfinite]) +AC_MSG_RESULT([${have_isfinite}]) + have_atfile_source=auto ------------------------------------------------------------------------------ Forrester Wave Report - Recovery time is now measured in hours and minutes not days. Key insights are discussed in the 2010 Forrester Wave Report as part of an in-depth evaluation of disaster recovery service providers. Forrester found the best-in-class provider in terms of services and vision. Read this report now! http://p.sf.net/sfu/ibm-webcastpromo _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel