[libcxx-commits] [libcxx] r352942 - Handle cases where the dirent::d_type macros aren't defined

Eric Fiselier via libcxx-commits libcxx-commits at lists.llvm.org
Fri Feb 1 15:52:17 PST 2019


Author: ericwf
Date: Fri Feb  1 15:52:17 2019
New Revision: 352942

URL: http://llvm.org/viewvc/llvm-project?rev=352942&view=rev
Log:
Handle cases where the dirent::d_type macros aren't defined

Modified:
    libcxx/trunk/src/filesystem/directory_iterator.cpp

Modified: libcxx/trunk/src/filesystem/directory_iterator.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/filesystem/directory_iterator.cpp?rev=352942&r1=352941&r2=352942&view=diff
==============================================================================
--- libcxx/trunk/src/filesystem/directory_iterator.cpp (original)
+++ libcxx/trunk/src/filesystem/directory_iterator.cpp Fri Feb  1 15:52:17 2019
@@ -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*
   }
   return file_type::none;
 }
+#endif // defined(DT_BLK)
 
 template <class DirEntT>
 static file_type get_file_type(DirEntT* ent, long) {




More information about the libcxx-commits mailing list