A testdir fails to compile on MSVC 14, because of this error: source='../../gllib/fts.c' object='fts.obj' libtool=no \ DEPDIR=.deps depmode=msvc7 /bin/sh ../../build-aux/depcomp \ /home/bruno/msvc/compile cl -nologo -DHAVE_CONFIG_H -DEXEEXT=\".exe\" -DEXEEXT=\".exe\" -DNO_XMALLOC -DEXEEXT=\".exe\" -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -D_WIN32_WINNT=_WIN32_WINNT_WIN7 -I/usr/local/msvc64/include -MD -c -o fts.obj `cygpath -w '../../gllib/fts.c'` fts.c c:\cygwin64\home\bruno\testdir-all\gllib\i-ring.h(21): warning C4116: unnamed type definition in parentheses C:\cygwin64\home\bruno\testdir-all\gllib\fts.c(1205): error C2065: 'S_IFBLK': undeclared identifier ... make[4]: *** [Makefile:10692: fts.obj] Error 2
This patch fixes it. 2022-09-04 Bruno Haible <br...@clisp.org> fts: Fix compilation error with MSVC 14. * lib/fts.c (S_IFBLK): Add fallback definition. diff --git a/lib/fts.c b/lib/fts.c index 494a63af96..a7b5b77d79 100644 --- a/lib/fts.c +++ b/lib/fts.c @@ -115,6 +115,9 @@ static char sccsid[] = "@(#)fts.c 8.6 (Berkeley) 8/14/94"; # define DT_SOCK 7 #endif +#ifndef S_IFBLK +# define S_IFBLK 0 +#endif #ifndef S_IFLNK # define S_IFLNK 0 #endif