Sandro Santilli wrote: > On Sat, Jan 23, 2010 at 2:40 AM, Mateusz Loskot <mate...@loskot.net> wrote: > >> The CMakeLists.txt in root was performing incorrect checks. >> It should be fine now, I hope. > > Still no lack. platform.h dropped, cmake ../trunk re-run. > The new platform still doesn't contain any valid FINITE function: > > /* Set to 1 if C++/C99 std::isfinite is defined */ > /* #undef HAVE_STD_ISFINITE */ > > /* Set to 1 if C99 isfinite is defined */ > /* #undef HAVE_ISFINITE */ > > /* Set to 1 if Visual C++ finite is defined */ > /* #undef HAVE_FINITE */ > > This is r2888.
Sandro, Thanks for testing! The problem is not with CMake, but looks like GCC is a mess :-) I'm a bit sick of the mess in how GCC handles C and C++ standards, it is by one big pollution. I've made a test by compiling this small program with two versions, fairly close versions, of GCC: #include <math.h> #ifdef isfinite #error isfinite defined #else #error isfinite NOT defined #endif int main() { return 0; } 1) mlos...@dog:~/tmp$ gcc --version gcc (Ubuntu 4.4.1-4ubuntu9) 4.4.1 mlos...@dog:~/tmp$ gcc isfinite.c isfinite.c:3:2: error: #error isfinite defined mlos...@dog:~/tmp$ 2) mlos...@vb-ubuntu904:~/tmp$ gcc --version gcc (Ubuntu 4.3.3-5ubuntu4) 4.3.3 mlos...@vb-ubuntu904:~/tmp$ gcc isfinite.c isfinite.c:5:2: error: #error isfinite NOT defined To make it working with GCC 4.3, one has to specify -std=c99 option. 3) What should we expect from GCC 4.5 ? Getting used to default behaviour of GCC from version to version is like chasing my own tail :-) I tried to force the isfinite with definitiosn of __USE_ISOC99 or _GNU_SOURCE but it doesn't help. I'll have to figure out best platform and GCC version independent option. The simplest one would be to define something like this: inline bool isfinite(double v) { return v >= -(std::numeric_limits<double>::max)() && v <= (std::numeric_limits<double>::max)(); } but I'm concerned if it is robust enough on variety of platforms. Best regards, -- Mateusz Loskot, http://mateusz.loskot.net Charter Member of OSGeo, http://osgeo.org _______________________________________________ geos-devel mailing list geos-devel@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/geos-devel