summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5match_types.c
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-05 22:17:13 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-05 22:17:13 (GMT)
commit8641814c4e5b4211e0980df783c3d2d25f484226 (patch)
tree14301cf1ffc17ffdc945aea72752ce41703c77a2 /fortran/src/H5match_types.c
parent043173a689015960758c0276486eca9e7a223366 (diff)
downloadhdf5-8641814c4e5b4211e0980df783c3d2d25f484226.zip
hdf5-8641814c4e5b4211e0980df783c3d2d25f484226.tar.gz
hdf5-8641814c4e5b4211e0980df783c3d2d25f484226.tar.bz2
[svn-r27154] fixed issue with mis-matching long double between Fortran and C
Diffstat (limited to 'fortran/src/H5match_types.c')
-rw-r--r--fortran/src/H5match_types.c28
1 files changed, 22 insertions, 6 deletions
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index 5ac5c80..366e3da 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -215,6 +215,7 @@ int main(void)
} else if(sizeof(double) == RealKinds_SizeOf[i]) {
writeTypedef("float", "double", RealKinds[i]);
strcpy(Real_C_TYPES[i], "C_DOUBLE");
+/* may not have long double in fortran need check */
} else if(sizeof(long double) == RealKinds_SizeOf[i] && found_long_double == 0) {
writeTypedef("float", "long double", RealKinds[i]);
strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE");
@@ -227,12 +228,27 @@ int main(void)
strcpy(Real_C_TYPES[i], "C_FLOAT128");
}
#endif
- else {
- printf(" **** HDF5 WARNING ****/n");
- printf("Fortran REAL is %d bytes, but no corresponding C floating type exists\n",RealKinds_SizeOf[i]);
- printf("Fortran Interfaces for Fortran REALs of %d bytes will not exist\n",RealKinds_SizeOf[i]);
- }
- }
+/* else { */
+ /* /\* Did not find the real type, use the next smallest *\/ */
+/* sprintf(chrA, "%d", RealKinds[i]); */
+/* if(sizeof(float) > RealKinds_SizeOf[H5_FORTRAN_NUM_REAL_KINDS-2]) { */
+/* writeTypedef("float", "float", RealKinds[i]); */
+/* strcpy(Real_C_TYPES[i], chrA); */
+/* } else if(sizeof(double) > RealKinds_SizeOf[H5_FORTRAN_NUM_REAL_KINDS-2]) { */
+/* writeTypedef("float", "double", RealKinds[i]); */
+/* strcpy(Real_C_TYPES[i], chrA); */
+/* } else if(sizeof(long double) > RealKinds_SizeOf[H5_FORTRAN_NUM_REAL_KINDS-2]) { */
+/* writeTypedef("float", "long double", RealKinds[i]); */
+/* strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); } */
+ else {
+ printf(" **** HDF5 WARNING ****\n");
+ printf("Fortran REAL is %d bytes, but no corresponding C floating type exists\n",RealKinds_SizeOf[i]);
+ printf("Fortran Interface will create a custom datatype to store Fortran Real\n",RealKinds_SizeOf[i]);
+
+ writeTypedef("float", "long double", RealKinds[i]);
+ strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE"); }
+ }
+/* } */
/* Now begin defining fortran types. */
fprintf(c_header, "\n");