This patch leads to a compilation error on macOS < 26:

/Users/runner/work/ci-scratch/ci-scratch/macos-compile clang -std=gnu23 
-DHAVE_CONFIG_H -I. -I../../gllib -I..  -DGNULIB_STRICT_CHECKING=1 
-I/Users/runner/include -I/opt/homebrew/opt/libiconv/include -Wall 
-DCONTINUE_AFTER_ASSERT  -g -MT lchown.o -MD -MP -MF .deps/lchown.Tpo -c -o 
lchown.o ../../gllib/lchown.c
../../gllib/lchown.c:140:39: error: use of undeclared identifier 
'get_stat_atime'
  140 |                ((struct timespec[]) { get_stat_atime (&st),
      |                                       ^
../../gllib/lchown.c:141:39: error: use of undeclared identifier 
'get_stat_mtime'
  141 |                                       get_stat_mtime (&st) }),
      |                                       ^
2 errors generated.
make[4]: *** [lchown.o] Error 1

This patch should fix it.


2025-09-21  Bruno Haible  <br...@clisp.org>

        lchown: Fix compilation error on macOS (regression today).
        * lib/lchown.c: Include stat-time.h.

diff --git a/lib/lchown.c b/lib/lchown.c
index ef92c18c8f..687922abd4 100644
--- a/lib/lchown.c
+++ b/lib/lchown.c
@@ -29,6 +29,7 @@
 #include <sys/stat.h>
 
 #include "issymlink.h"
+#include "stat-time.h"
 
 #ifndef CHOWN_CHANGE_TIME_BUG
 # define CHOWN_CHANGE_TIME_BUG 0




Reply via email to