public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-7176] libstdc++: Fix directory iterator build for newlib Date: Thu, 10 Feb 2022 13:02:13 +0000 (GMT) [thread overview] Message-ID: <20220210130213.7FB803858406@sourceware.org> (raw) https://gcc.gnu.org/g:3d5f4f76e6db0895181ebca538748379bfe6058f commit r12-7176-g3d5f4f76e6db0895181ebca538748379bfe6058f Author: Jonathan Wakely <jwakely@redhat.com> 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 <fcntl.h> is only included when HAVE_DIRENT_H is defined. Since directory iterators are completely useless without <dirent.h>, just override the HAVE_OPENAT and HAVE_UNLINKAT detection when we don't have <dirent.h>. libstdc++-v3/ChangeLog: * src/filesystem/dir-common.h (_GLIBCXX_HAVE_DIRFD): Undefine when <dirent.h> 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
reply other threads:[~2022-02-10 13:02 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220210130213.7FB803858406@sourceware.org \ --to=redi@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).