From 0d994cb8ed47f3fb68c9c68a126e1451fa5da275 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 25 Jul 2024 00:32:26 +0200 Subject: [PATCH] Avoid false fstat_used_without_requesting_gnulib_module_fstat. * modules/fstat (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_stat.in.h (fstat): Don't define to fstat_used_without_requesting_gnulib_module_fstat if the gnulib module 'fstat' is in use under the same configure.ac. --- ChangeLog | 6 ++++++ lib/sys_stat.in.h | 6 ++++-- modules/fstat | 1 + 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26921b3ab2..6590174d37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2024-07-24 Bruno Haible + Avoid false fstat_used_without_requesting_gnulib_module_fstat. + * modules/fstat (configure.ac): Invoke gl_MODULE_INDICATOR. + * lib/sys_stat.in.h (fstat): Don't define to + fstat_used_without_requesting_gnulib_module_fstat if the gnulib module + 'fstat' is in use under the same configure.ac. + Avoid false stat_used_without_requesting_gnulib_module_stat. * modules/stat (configure.ac): Invoke gl_MODULE_INDICATOR. * lib/sys_stat.in.h (stat): Don't define to diff --git a/lib/sys_stat.in.h b/lib/sys_stat.in.h index cc41875442..4f2fb06417 100644 --- a/lib/sys_stat.in.h +++ b/lib/sys_stat.in.h @@ -518,8 +518,10 @@ _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf)); _GL_CXXALIASWARN (fstat); # endif #elif @GNULIB_OVERRIDES_STRUCT_STAT@ -# undef fstat -# define fstat fstat_used_without_requesting_gnulib_module_fstat +# if !GNULIB_FSTAT +# undef fstat +# define fstat fstat_used_without_requesting_gnulib_module_fstat +# endif #elif @WINDOWS_64_BIT_ST_SIZE@ /* Above, we define stat to _stati64. */ # define fstat _fstati64 diff --git a/modules/fstat b/modules/fstat index ddc26eb6f6..0c168a7bcd 100644 --- a/modules/fstat +++ b/modules/fstat @@ -29,6 +29,7 @@ AM_COND_IF([GL_COND_OBJ_FSTAT], [ gl_PREREQ_FSTAT ]) gl_SYS_STAT_MODULE_INDICATOR([fstat]) +gl_MODULE_INDICATOR([fstat]) Makefile.am: if GL_COND_OBJ_FSTAT -- 2.39.5