From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 7FB803858406; Thu, 10 Feb 2022 13:02:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FB803858406 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-7176] libstdc++: Fix directory iterator build for newlib X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 0f58ba4dd6b25b16d25494ae18d15dfa681f9b65 X-Git-Newrev: 3d5f4f76e6db0895181ebca538748379bfe6058f Message-Id: <20220210130213.7FB803858406@sourceware.org> Date: Thu, 10 Feb 2022 13:02:13 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2022 13:02:13 -0000 https://gcc.gnu.org/g:3d5f4f76e6db0895181ebca538748379bfe6058f commit r12-7176-g3d5f4f76e6db0895181ebca538748379bfe6058f Author: Jonathan Wakely Date: Tue Feb 8 21:05:30 2022 +0000 libstdc++: Fix directory iterator build for newlib When building for newlib HAVE_OPENAT and HAVE_UNLINKAT are (sometimes?) defined, but is only included when HAVE_DIRENT_H is defined. Since directory iterators are completely useless without , just override the HAVE_OPENAT and HAVE_UNLINKAT detection when we don't have . libstdc++-v3/ChangeLog: * src/filesystem/dir-common.h (_GLIBCXX_HAVE_DIRFD): Undefine when is not available. (_GLIBCXX_HAVE_UNLINKAT): Likewise. Diff: --- libstdc++-v3/src/filesystem/dir-common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libstdc++-v3/src/filesystem/dir-common.h b/libstdc++-v3/src/filesystem/dir-common.h index 511b988f1c7..365fd527f4d 100644 --- a/libstdc++-v3/src/filesystem/dir-common.h +++ b/libstdc++-v3/src/filesystem/dir-common.h @@ -70,6 +70,8 @@ struct DIR { }; inline DIR* opendir(const char*) { return nullptr; } inline dirent* readdir(DIR*) { return nullptr; } inline int closedir(DIR*) { return -1; } +#undef _GLIBCXX_HAVE_DIRFD +#undef _GLIBCXX_HAVE_UNLINKAT #endif } // namespace __gnu_posix