summaryrefslogtreecommitdiffstats
path: root/src/H5Tpkg.h
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2006-06-23 22:11:12 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2006-06-23 22:11:12 (GMT)
commit4dfad81062f0b195ee9fd10f0b4e5ba2f6056aeb (patch)
treedd1beab639cb485e8c4b785112f00081c4d7d321 /src/H5Tpkg.h
parent842895a79950c2d43958831991a97802bcd58431 (diff)
downloadhdf5-4dfad81062f0b195ee9fd10f0b4e5ba2f6056aeb.zip
hdf5-4dfad81062f0b195ee9fd10f0b4e5ba2f6056aeb.tar.gz
hdf5-4dfad81062f0b195ee9fd10f0b4e5ba2f6056aeb.tar.bz2
[svn-r12435] Purpose: Bug fix
Description: Mac OS 10.4 on PowerPC chip has some errors to convert (unsigned) long long to long double. When the bit sequences are 0x003ff..., 0x007fff..., 0x00ffff..., 0x01ffff..., 0x7fffff..., the converted values are twice as big as they should be. Solution: Detect the error in configure and disable the compiler conversion and test case. Platforms tested: h5committest, Mac OS 10.4, and fuss.
Diffstat (limited to 'src/H5Tpkg.h')
-rw-r--r--src/H5Tpkg.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 9a5ab33..ee0939e 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -99,6 +99,13 @@
#define H5T_CONV_INTERNAL_ULONG_LDOUBLE 1
#endif
+/* Define an internal macro for converting long long to long double. Mac OS 10.4 gives some
+ * incorrect conversions. */
+#if (H5_WANT_DATA_ACCURACY && H5_INTEGER_TO_LDOUBLE_ACCURATE && H5_LLONG_TO_LDOUBLE_CORRECT) || \
+ (!H5_WANT_DATA_ACCURACY)
+#define H5T_CONV_INTERNAL_LLONG_LDOUBLE 1
+#endif
+
/* Define an internal macro for converting unsigned long long to floating numbers. SGI compilers give
* some incorect conversion. 64-bit Solaris does different rounding. Windows Visual Studio 6 does
* not support unsigned long long. */
@@ -110,9 +117,11 @@
/* Define an internal macro for converting unsigned long long to long double. SGI compilers give
* some incorect conversion. 64-bit Solaris does different rounding. Windows Visual Studio 6 does
* not support unsigned long long. For FreeBSD(sleipnir), the last 2 bytes of mantissa are lost when
- * compiler tries to do the conversion. For Cygwin, compiler doesn't do rounding correctly. */
+ * compiler tries to do the conversion. For Cygwin, compiler doesn't do rounding correctly.
+ * Mac OS 10.4 gives some incorrect result. */
#if (H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS && H5_ULONG_TO_FP_BOTTOM_BIT_ACCURATE && \
- H5_ULLONG_TO_LDOUBLE_PRECISION) || (!H5_WANT_DATA_ACCURACY && H5_ULLONG_TO_FP_CAST_WORKS)
+ H5_ULLONG_TO_LDOUBLE_PRECISION && H5_LLONG_TO_LDOUBLE_CORRECT) || (!H5_WANT_DATA_ACCURACY && \
+ H5_ULLONG_TO_FP_CAST_WORKS)
#define H5T_CONV_INTERNAL_ULLONG_LDOUBLE 1
#endif