Skip to content

Commit

Permalink
renamed defined H5_VERS* to avoid conflicts (HDFGroup#3926)
Browse files Browse the repository at this point in the history
  • Loading branch information
brtnfld authored and lrknox committed Jan 5, 2024
1 parent c62278f commit e6597ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down Expand Up @@ -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`"
Expand Down
6 changes: 3 additions & 3 deletions fortran/src/H5config_f.inc.in
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit e6597ae

Please sign in to comment.