public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-11041] libstdc++: Fix directory iterator build for newlib
@ 2023-10-04 11:28 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-10-04 11:28 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:9e9a7d83d3326689bf6fbe72c62b125fd5cb442d

commit r11-11041-g9e9a7d83d3326689bf6fbe72c62b125fd5cb442d
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.
    
    (cherry picked from commit 3d5f4f76e6db0895181ebca538748379bfe6058f)

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 647cd7a6e5c..9c088a22c24 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-10-04 11:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-04 11:28 [gcc r11-11041] libstdc++: Fix directory iterator build for newlib Jonathan Wakely

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).