From e6597ae6aacb393dfae53bdeb1bc12b1836d90f4 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Fri, 5 Jan 2024 06:55:54 -0600 Subject: [PATCH] renamed defined H5_VERS* to avoid conflicts (#3926) --- configure.ac | 10 ++++++++-- fortran/src/H5config_f.inc.in | 6 +++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 9128faa1f96..76303d340a5 100644 --- a/configure.ac +++ b/configure.ac @@ -591,12 +591,19 @@ if test "X$HDF_FORTRAN" = "Xyes"; then AC_DEFINE_UNQUOTED([PAC_C_MAX_REAL_PRECISION], $PAC_C_MAX_REAL_PRECISION, [Determine the maximum decimal precision in C]) AC_MSG_RESULT([$PAC_C_MAX_REAL_PRECISION]) + VERS_MAJOR=`cat $srcdir/src/H5public.h | sed -n 's/^#define H5_VERS_MAJOR //p'` + VERS_MINOR=`cat $srcdir/src/H5public.h | sed -n 's/^#define H5_VERS_MINOR //p'` + VERS_RELEASE=`cat $srcdir/src/H5public.h | sed -n 's/^#define H5_VERS_RELEASE //p'` + AC_DEFINE_UNQUOTED([VERS_MAJOR_TMP], $VERS_MAJOR, [Define major library version]) + AC_DEFINE_UNQUOTED([VERS_MINOR_TMP], $VERS_MINOR, [Define minor library version]) + AC_DEFINE_UNQUOTED([VERS_RELEASE_TMP], $VERS_RELEASE, [Define release library version]) + ## We will output an include file for Fortran, H5config_f.inc which ## contains various configure definitions used by the Fortran Library. ## Prepend H5_ to all macro names. This avoids name conflict between HDF5 macro ## names and those generated by another software package that uses the HDF5 library. AC_CONFIG_HEADERS([fortran/src/H5config_f.inc], - [cat fortran/src/H5config_f.inc | sed '1d;s%^/\* \(.*\) \*/%\1%;s/#define /#define H5_/;s/#undef /#undef H5_/' >fortran/src/H5config_f.inc.tmp; mv -f fortran/src/H5config_f.inc.tmp fortran/src/H5config_f.inc]) + [cat fortran/src/H5config_f.inc | sed '1d;s%^/\* \(.*\) \*/%\1%;s/#define /#define H5_/;s/#undef /#undef H5_/' >fortran/src/H5config_f.inc.tmp; sed -i 's\_TMP\\g' fortran/src/H5config_f.inc.tmp; mv -f fortran/src/H5config_f.inc.tmp fortran/src/H5config_f.inc]) AC_SUBST([FC]) @@ -3675,7 +3682,6 @@ fi ## HDF5 version from the first line of the README.md file. H5_VERSION="`cut -d' ' -f3 $srcdir/README.md | head -1`" AC_SUBST([H5_VERSION]) - - ## Configuration date AC_SUBST([CONFIG_DATE]) CONFIG_DATE="`date`" diff --git a/fortran/src/H5config_f.inc.in b/fortran/src/H5config_f.inc.in index 5fe1bcc663a..afcfa6e0f76 100644 --- a/fortran/src/H5config_f.inc.in +++ b/fortran/src/H5config_f.inc.in @@ -81,13 +81,13 @@ #undef NO_DEPRECATED_SYMBOLS ! For major interface/format changes -#undef VERS_MAJOR +#undef VERS_MAJOR_TMP ! For minor interface/format changes -#undef VERS_MINOR +#undef VERS_MINOR_TMP ! For tweaks, bug-fixes, or development -#undef VERS_RELEASE +#undef VERS_RELEASE_TMP ! macros for comparing versions #define VERSION_GE(Maj, Min, Rel) \