summaryrefslogtreecommitdiffstats
path: root/fortran/src
diff options
context:
space:
mode:
Diffstat (limited to 'fortran/src')
-rw-r--r--fortran/src/H5match_types.c10
-rw-r--r--fortran/src/H5test_kind.F903
-rw-r--r--fortran/src/Makefile.am9
-rw-r--r--fortran/src/Makefile.in11
4 files changed, 18 insertions, 15 deletions
diff --git a/fortran/src/H5match_types.c b/fortran/src/H5match_types.c
index 35dbc19..2067f60 100644
--- a/fortran/src/H5match_types.c
+++ b/fortran/src/H5match_types.c
@@ -206,15 +206,19 @@ int main(void)
/* (b) Define c_float_x */
+ /* make sure we find long double first before checking for __float128
+ * ideally we need to match precision instead of matching sizeof */
+
+ int found_longdb = 0;
for(i=0;i< H5_FORTRAN_NUM_REAL_KINDS;i++) {
-#ifdef HAVE_FLOAT128
-/* should fail */
- if(sizeof(__float128) == RealKinds_SizeOf[i]) {
+#ifdef H5_HAVE_FLOAT128
+ if(sizeof(__float128) == RealKinds_SizeOf[i] && found_longdb == 1) {
writeTypedef("float", "__float128", RealKinds[i]);
strcpy(Real_C_TYPES[i], "C_FLOAT128");
} else
#endif
if(sizeof(long double) == RealKinds_SizeOf[i]) {
+ found_longdb = 1;
writeTypedef("float", "long double", RealKinds[i]);
strcpy(Real_C_TYPES[i], "C_LONG_DOUBLE");
} else if(sizeof(double) == RealKinds_SizeOf[i]) {
diff --git a/fortran/src/H5test_kind.F90 b/fortran/src/H5test_kind.F90
index 7c5a6d6..018e603 100644
--- a/fortran/src/H5test_kind.F90
+++ b/fortran/src/H5test_kind.F90
@@ -117,6 +117,8 @@ PROGRAM test_kind
ENDIF
ENDDO
+ GOTO 10
+
! Generate program information:
WRITE(*,'(40(A,/))') &
@@ -312,6 +314,7 @@ WRITE(*,'(40(A,/))') &
WRITE(*,*) "END PROGRAM H5test_kind"
+10 CONTINUE
! (c) Generate Fortran H5* interfaces having multiple KIND interfaces.
!
diff --git a/fortran/src/Makefile.am b/fortran/src/Makefile.am
index 43a5f3f..d2e06f8 100644
--- a/fortran/src/Makefile.am
+++ b/fortran/src/Makefile.am
@@ -60,8 +60,7 @@ DISTCLEANFILES=h5fc
# H5fortran_types.F90 and H5f90i.h are automatically generaed by
# H5match_types, and must be cleaned explicitly. H5fort_type_defines.h
# is generated by H5fortran_detect
-MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h \
- H5fortran_detect.F90
+MOSTLYCLEANFILES=H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h
# Fortran module files can have different extensions and different names
# (e.g., different capitalizations) on different platforms. Write rules
@@ -138,11 +137,11 @@ H5fortran_types.F90 H5f90i_gen.h: H5match_types$(EXEEXT)
# files.
#H5fortran_detect_SOURCES = H5fortran_detect.F90
-# H5test_kind.F90 generates H5Fortran_detect.F90 depending on if
-# intrinsic function SIZEOF is available.
+# H5test_kind.F90 generates all the APIs that have a KIND type associated
+# with them.
H5_KINDff.F90: H5test_kind$(EXEEXT)
- $(RUNSERIAL) ./H5test_kind$(EXEEXT) > H5fortran_detect.F90
+ $(RUNSERIAL) ./H5test_kind$(EXEEXT)
# H5test_kind.F90 is included in the distribution, and Automake knows
# how to compile a fortran program given its sources.
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 1de8d8a..43cc686 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -514,7 +514,6 @@ H5_LDFLAGS = @H5_LDFLAGS@
H5_VERSION = @H5_VERSION@
HADDR_T = @HADDR_T@
HAVE_DMALLOC = @HAVE_DMALLOC@
-HAVE_FLOAT128 = @HAVE_FLOAT128@
HAVE_PTHREAD = @HAVE_PTHREAD@
HDF5_HL = @HDF5_HL@
HDF5_INTERFACES = @HDF5_INTERFACES@
@@ -746,9 +745,7 @@ DISTCLEANFILES = h5fc
# H5fortran_types.F90 and H5f90i.h are automatically generaed by
# H5match_types, and must be cleaned explicitly. H5fort_type_defines.h
# is generated by H5fortran_detect
-MOSTLYCLEANFILES = H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h \
- H5fortran_detect.F90
-
+MOSTLYCLEANFILES = H5fortran_types.F90 H5f90i_gen.h H5fort_type_defines.h
@BUILD_PARALLEL_CONDITIONAL_FALSE@H5FC_NAME = h5fc
# Custom rule for installing h5fc, since it will be named h5pfc if hdf5
@@ -1399,11 +1396,11 @@ H5fortran_types.F90 H5f90i_gen.h: H5match_types$(EXEEXT)
# files.
#H5fortran_detect_SOURCES = H5fortran_detect.F90
-# H5test_kind.F90 generates H5Fortran_detect.F90 depending on if
-# intrinsic function SIZEOF is available.
+# H5test_kind.F90 generates all the APIs that have a KIND type associated
+# with them.
H5_KINDff.F90: H5test_kind$(EXEEXT)
- $(RUNSERIAL) ./H5test_kind$(EXEEXT) > H5fortran_detect.F90
+ $(RUNSERIAL) ./H5test_kind$(EXEEXT)
# Hardcode the dependencies of these files. There isn't a known way of
# determining this automagically (like we do with the C files). So, when