summaryrefslogtreecommitdiffstats
path: root/configure.in
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2005-01-14 20:15:34 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2005-01-14 20:15:34 (GMT)
commit105bee4ead610d183af62e08b4f7c219ba0ea6a9 (patch)
tree5f2525c1045a9dfa3f8731b84bedfa0b80ad3e4e /configure.in
parent23130b569c3846a1fd098841bb2f9912dd9040de (diff)
downloadhdf5-105bee4ead610d183af62e08b4f7c219ba0ea6a9.zip
hdf5-105bee4ead610d183af62e08b4f7c219ba0ea6a9.tar.gz
hdf5-105bee4ead610d183af62e08b4f7c219ba0ea6a9.tar.bz2
[svn-r9826] Purpose: Bug fix
Description: Intel compiler on Linux has some problem to convert long double to unsigned int correctly. Solution: Detect the problem in configure and define a macro to skip this test if it happens. Platforms tested: eirene and fuss. Simple change.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index b9c3846..7790aab 100644
--- a/configure.in
+++ b/configure.in
@@ -2734,6 +2734,37 @@ else
AC_MSG_RESULT([no])
fi
+dnl ----------------------------------------------------------------------
+dnl Set the flag to indicate that the machine can accurately convert
+dnl 'long double' to 'unsigned int' values. (This flag should be set for
+dnl all machines, except for some Intel compilers on some Linux.)
+dnl
+AC_MSG_CHECKING([if converting long double to unsigned int values works])
+
+AC_CACHE_VAL([hdf5_cv_ldouble_to_uint_works],
+ [AC_TRY_RUN([
+ int main(void)
+ {
+ long double ld = 2733248032.9183987530L;
+ unsigned int i;
+ int ret = 0;
+
+ i = (unsigned int)ld;
+ if(i!=2733248032 && i!=2733248031 && i!=2733248033)
+ ret = 1;
+
+done:
+ exit(ret);
+ }
+ ], [hdf5_cv_ldouble_to_uint_works=yes], [hdf5_cv_ldouble_to_uint_works=no],)])
+
+if test ${hdf5_cv_ldouble_to_uint_works} = "yes"; then
+ AC_DEFINE([CV_LDOUBLE_TO_UINT_WORKS], [1],
+ [Define if your system can convert long double to unsigned int values correctly.])
+ AC_MSG_RESULT([yes])
+else
+ AC_MSG_RESULT([no])
+fi
dnl ----------------------------------------------------------------------
dnl Set the flag to indicate that the machine can _compile_