summaryrefslogtreecommitdiffstats
path: root/fortran/src
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-10 19:15:08 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-10 19:15:08 (GMT)
commitf2d14c76b8a8e7c09285fff9db25b101a84354b0 (patch)
tree3140de51fe2de7881be06500a426f51e8b288dea /fortran/src
parent202ea3747ebc1bca71c455ca083492960f032ec5 (diff)
downloadhdf5-f2d14c76b8a8e7c09285fff9db25b101a84354b0.zip
hdf5-f2d14c76b8a8e7c09285fff9db25b101a84354b0.tar.gz
hdf5-f2d14c76b8a8e7c09285fff9db25b101a84354b0.tar.bz2
[svn-r27186] added fix for jam with promoted reals and integers
Diffstat (limited to 'fortran/src')
-rw-r--r--fortran/src/H5_f.c8
-rw-r--r--fortran/src/H5match_types.c10
-rw-r--r--fortran/src/Makefile.in1
3 files changed, 18 insertions, 1 deletions
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index cca36fb..f21528f 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -22,7 +22,7 @@
*/
#include "H5f90.h"
-
+#include "H5fort_type_defines.h"
/****if* H5_f/h5init_types_c
* NAME
* h5init_types_c
@@ -92,6 +92,12 @@ h5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertypes
if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_LDOUBLE)) < 0) return ret_value;
}/*end else */
#endif
+#ifdef H5_HAVE_FLOAT128
+ else if(sizeof(double_f)==sizeof(__float128)) {
+ if ((types[2] = H5Tcopy (H5T_NATIVE_FLOAT)) < 0) return ret_value;
+ if ( H5Tset_precision (types[2], 128) < 0) return ret_value;
+ }/*end else */
+#endif
/*
if ((types[3] = H5Tcopy(H5T_NATIVE_UINT8)) < 0) return ret_value;
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index cac50ab..b0e682d 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -488,6 +488,16 @@ int main(void)
writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_DOUBLE");
else if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF == sizeof(float))
writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_FLOAT");
+#ifdef H5_HAVE_FLOAT128
+ /* Don't select a higher precision than Fortran can support */
+ else if(sizeof(__float128) == H5_FORTRAN_NATIVE_DOUBLE_SIZEOF && H5_PAC_FC_MAX_REAL_PRECISION > 28) {
+ writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_FLOAT128");
+ }
+#else
+ else if(sizeof(long double) == H5_FORTRAN_NATIVE_DOUBLE_SIZEOF && H5_PAC_FC_MAX_REAL_PRECISION > 28) {
+ writeToFilesChr("float","Fortran_DOUBLE", "double_f", H5_FORTRAN_NATIVE_DOUBLE_KIND, "C_FLOAT128");
+ }
+#endif
else {
/* /\* No exact match, choose the next highest *\/ */
/* if(H5_FORTRAN_NATIVE_DOUBLE_SIZEOF > sizeof(long double)) */
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 5c9de7c..eac35d6 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -505,6 +505,7 @@ FC_VERSION = @FC_VERSION@
FGREP = @FGREP@
FORTRAN_C_LONG_DOUBLE_IS_UNIQUE = @FORTRAN_C_LONG_DOUBLE_IS_UNIQUE@
FORTRAN_HAVE_C_LONG_DOUBLE = @FORTRAN_HAVE_C_LONG_DOUBLE@
+FORTRAN_SIZEOF_LONG_DOUBLE = @FORTRAN_SIZEOF_LONG_DOUBLE@
FSEARCH_DIRS = @FSEARCH_DIRS@
GREP = @GREP@
H5_CFLAGS = @H5_CFLAGS@