summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2006-06-20 14:45:37 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2006-06-20 14:45:37 (GMT)
commit823fbd0e885aa28aafb17746c8040a3c65fbb893 (patch)
treed5e12f73e08e6909883513a79d9de9da43806277 /src
parent9db9e82cd1c4e35c6e64fbb2da5eb1db95a0fb55 (diff)
downloadhdf5-823fbd0e885aa28aafb17746c8040a3c65fbb893.zip
hdf5-823fbd0e885aa28aafb17746c8040a3c65fbb893.tar.gz
hdf5-823fbd0e885aa28aafb17746c8040a3c65fbb893.tar.bz2
[svn-r12425] Purpose: Bug fix
Description: Data conversion from long double to (unsigned) long long returns some incorrect values on Mac OS 10.4 and SGI IRIX64 6.5. The conversions start to go wrong when the long double is 20041683600089727.779961 (0x4351ccf385ebc8a0bfcc2a...). If adjusting the values higher by assigning 0x...c8a0cf... or 0x...c8a0df..., the converted values go wild. Solution: Detect this error in configure.in and disable compiler conversions from long double to (unsigned) long long for Mac OS 10.4 and IRIX64 6.5. Platforms tested: h5committest, Mac OS 10.4, and IRIX64 6.5.
Diffstat (limited to 'src')
-rw-r--r--src/H5Tpkg.h13
-rw-r--r--src/H5config.h.in4
2 files changed, 11 insertions, 6 deletions
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 522329b..9a5ab33 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -138,10 +138,10 @@
#endif
/* Define an internal macro for converting long double to long long. SGI compilers give some incorrect
- * conversions. HP-UX 11.00 compiler generates floating exception. The hard conversion on Windows
- * .NET 2003 has a bug and gives wrong exception value. */
+ * conversions. Mac OS 10.4 gives incorrect conversions. HP-UX 11.00 compiler generates floating exception.
+ * The hard conversion on Windows .NET 2003 has a bug and gives wrong exception value. */
#if (H5_WANT_DATA_ACCURACY && !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_LDOUBLE_TO_INTEGER_ACCURATE && \
- H5_LDOUBLE_TO_INTEGER_WORKS) || \
+ H5_LDOUBLE_TO_INTEGER_WORKS && H5_LDOUBLE_TO_LLONG_ACCURATE) || \
(!H5_WANT_DATA_ACCURACY && !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_LDOUBLE_TO_INTEGER_WORKS)
#define H5T_CONV_INTERNAL_LDOUBLE_LLONG 1
#endif
@@ -156,10 +156,11 @@
#define H5T_CONV_INTERNAL_FP_ULLONG 0
#endif
-/* Define an internal macro for converting long double to all integers. SGI compilers give some incorrect
- * conversions. HP-UX 11.00 compiler generates floating exception. */
+/* Define an internal macro for converting long double to unsigned long long. SGI compilers give some
+ * incorrect conversions. Mac OS 10.4 gives incorrect conversions. HP-UX 11.00 compiler generates
+ * floating exception. */
#if (H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_ACCURATE && H5_LDOUBLE_TO_INTEGER_WORKS && \
- H5_FP_TO_ULLONG_ACCURATE && H5_FP_TO_ULLONG_RIGHT_MAXIMUM) || \
+ H5_FP_TO_ULLONG_ACCURATE && H5_FP_TO_ULLONG_RIGHT_MAXIMUM && H5_LDOUBLE_TO_LLONG_ACCURATE) || \
(!H5_WANT_DATA_ACCURACY && H5_LDOUBLE_TO_INTEGER_WORKS)
#define H5T_CONV_INTERNAL_LDOUBLE_ULLONG 1
#else
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 15bb630..5497037 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -383,6 +383,10 @@
/* Define if your system can convert from long double to integer values. */
#undef LDOUBLE_TO_INTEGER_WORKS
+/* Define if your system can convert long double to (unsigned) long long
+ values correctly. */
+#undef LDOUBLE_TO_LLONG_ACCURATE
+
/* Define if your system can convert long double to unsigned int values
correctly. */
#undef LDOUBLE_TO_UINT_ACCURATE