Hi/2. Bruno Haible wrote: > KO Myung-Hun wrote: >> * lib/closedir.c (closedir): Use Windows code path. >> * lib/dirent.in.h (_gl_register_dirp_fd, _gl_unregister_dirp_fd): >> Remove. >> * lib/dirfd.c (_gl_register_dirp_fd, _gl_unregister_dirp_fd): Remove. >> (dirfd): Use Windows code path. >> * lib/fdopendir.c (fdopendir): Use Windows code path. >> * lib/opendir.c (opendir): Use Windows code path. >> * m4/closedir.m4 (REPLACE_CLOSEDIR): Use Windows code path. >> * m4/dirent_h.m4 (DIR_HAS_FD_MEMBER): Use Windows code path. >> * m4/dirfd.m4 (REPLACE_DIRFD): Use Windows code path. >> * m4/fchdir.m4 (HAVE_FCHDIR): Replace fchdir() if dirfd() does not work. >> * m4/opendir.m4 (REPLACE_OPENDIR): Use Windows code path. >> * m4/readdir.m4 (REPLACE_READDIR): Use Windows code path. >> * m4/rewinddir.m4 (REPLACE_REWINDDIR): Use Windows code path. >> * modules/fchdir (Depends-on): Include dirent always. > > Thanks for the nice simplification. I'm applying it, together with this > patch: >
This patch breaks compilation like this: ----- gcc -DHAVE_CONFIG_H -I. -I.. -DGNULIB_STRICT_CHECKING=1 -g -O2 -MT fdopendir.o -MD -MP -MF .deps/fdopendir.Tpo -c -o fdopendir.o fdopendir.c fdopendir.c:34:5: error: #error "unexpected configuration: GNULIB_defined_DIR but fchdir not replaced" 34 | # error "unexpected configuration: GNULIB_defined_DIR but fchdir not replaced" | ^~~~~ ----- [...] I attach a patch. Thanks! -- KO Myung-Hun Korean OS/2 User Community : https://www.os2.kr/
From 6fea43e316cb4a22b4534ecb9d83dfed33f8d18a Mon Sep 17 00:00:00 2001 From: KO Myung-Hun <komh@chollian.net> Date: Mon, 2 Oct 2023 23:07:43 +0900 Subject: [PATCH 1/2] fchdir: Define REPLACE_FCHDIR to 1 if fchdir() should be replaced In fdopendir.c, GNULIB_defined_DIR requires REPLACE_FCHDIR to be defined. * m4/fchdir.m4 (gl_FUNC_FCHDIR): Define REPLACE_FCHDIR macro to 1 if REPLACE_FCHDIR is 1. --- m4/fchdir.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/fchdir.m4 b/m4/fchdir.m4 index ff92ceca2e..d160e49c8a 100644 --- a/m4/fchdir.m4 +++ b/m4/fchdir.m4 @@ -1,4 +1,4 @@ -# fchdir.m4 serial 31 +# fchdir.m4 serial 32 dnl Copyright (C) 2006-2023 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -24,7 +24,7 @@ AC_DEFUN([gl_FUNC_FCHDIR], fi fi - if test $HAVE_FCHDIR = 0; then + if test $HAVE_FCHDIR = 0 || test $REPLACE_FCHDIR = 1; then AC_DEFINE([REPLACE_FCHDIR], [1], [Define to 1 if gnulib's fchdir() replacement is used.]) dnl We must also replace anything that can manipulate a directory fd, -- 2.39.1