summaryrefslogtreecommitdiffstats
path: root/libcxx/src/filesystem
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2019-02-01 23:52:17 +0000
committerEric Fiselier <eric@efcs.ca>2019-02-01 23:52:17 +0000
commit1bccafe4f6f2b8e6496641e55cccb2dab2da58e2 (patch)
treefaf9f5ffcb9595db64f6a2ef4c4abca883a1f6db /libcxx/src/filesystem
parent329010e1b58e91cc755495557d018aec2fe22af5 (diff)
downloadbcm5719-llvm-1bccafe4f6f2b8e6496641e55cccb2dab2da58e2.tar.gz
bcm5719-llvm-1bccafe4f6f2b8e6496641e55cccb2dab2da58e2.zip
Handle cases where the dirent::d_type macros aren't defined
llvm-svn: 352942
Diffstat (limited to 'libcxx/src/filesystem')
-rw-r--r--libcxx/src/filesystem/directory_iterator.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libcxx/src/filesystem/directory_iterator.cpp b/libcxx/src/filesystem/directory_iterator.cpp
index edecf69ef98..ca88dee0640 100644
--- a/libcxx/src/filesystem/directory_iterator.cpp
+++ b/libcxx/src/filesystem/directory_iterator.cpp
@@ -24,6 +24,8 @@ namespace detail {
namespace {
#if !defined(_LIBCPP_WIN32API)
+
+#if defined(DT_BLK)
template <class DirEntT, class = decltype(DirEntT::d_type)>
static file_type get_file_type(DirEntT* ent, int) {
switch (ent->d_type) {
@@ -49,6 +51,7 @@ static file_type get_file_type(DirEntT* ent, int) {
}
return file_type::none;
}
+#endif // defined(DT_BLK)
template <class DirEntT>
static file_type get_file_type(DirEntT* ent, long) {
OpenPOWER on IntegriCloud