[libcxx-commits] [PATCH] D66986: [libc++] Fix directory_iterator compilation on Win32
Stefan Schmidt via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Aug 29 17:41:23 PDT 2019
thrimbor created this revision.
Herald added a reviewer: EricWF.
Herald added subscribers: libcxx-commits, ldionne.
This patch fixes some typos and other small errors in directory_iterator.cpp that prevented this file from being compiled for Win32.
Repository:
rCXX libc++
https://reviews.llvm.org/D66986
Files:
src/filesystem/directory_iterator.cpp
Index: src/filesystem/directory_iterator.cpp
===================================================================
--- src/filesystem/directory_iterator.cpp
+++ src/filesystem/directory_iterator.cpp
@@ -10,7 +10,7 @@
#include "__config"
#if defined(_LIBCPP_WIN32API)
#define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
+#include <windows.h>
#else
#include <dirent.h>
#endif
@@ -79,14 +79,14 @@
return file_type::unknown;
}
static uintmax_t get_file_size(const WIN32_FIND_DATA& data) {
- return (data.nFileSizeHight * (MAXDWORD + 1)) + data.nFileSizeLow;
+ return (data.nFileSizeHigh * (MAXDWORD + 1)) + data.nFileSizeLow;
}
static file_time_type get_write_time(const WIN32_FIND_DATA& data) {
ULARGE_INTEGER tmp;
- FILETIME& time = data.ftLastWriteTime;
+ const FILETIME& time = data.ftLastWriteTime;
tmp.u.LowPart = time.dwLowDateTime;
tmp.u.HighPart = time.dwHighDateTime;
- return file_time_type(file_time_type::duration(time.QuadPart));
+ return file_time_type(file_time_type::duration(tmp.QuadPart));
}
#endif
@@ -110,7 +110,7 @@
__dir_stream(const path& root, directory_options opts, error_code& ec)
: __stream_(INVALID_HANDLE_VALUE), __root_(root) {
- __stream_ = ::FindFirstFileEx(root.c_str(), &__data_);
+ __stream_ = ::FindFirstFile(root.c_str(), &__data_);
if (__stream_ == INVALID_HANDLE_VALUE) {
ec = error_code(::GetLastError(), generic_category());
const bool ignore_permission_denied =
@@ -140,7 +140,7 @@
//cdata.__write_time_ = get_write_time(__data_);
__entry_.__assign_iter_entry(
__root_ / __data_.cFileName,
- directory_entry::__create_iter_result(get_file_type(__data)));
+ directory_entry::__create_iter_result(detail::get_file_type(__data)));
return true;
}
ec = error_code(::GetLastError(), generic_category());
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66986.218006.patch
Type: text/x-patch
Size: 1863 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190830/3e4a825e/attachment.bin>
More information about the libcxx-commits
mailing list