summaryrefslogtreecommitdiffstats
path: root/libcxx/src
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-01-30 19:57:27 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-01-30 19:57:27 +0000
commitcd79d0f5f36332bcc9ad5c70c314dcbad4f8886d (patch)
treed6cc3317feff28523cfe017e001949f4cb8148f8 /libcxx/src
parent1f2ca6631713e16a31ca0dd879ee621011a0bcd0 (diff)
downloadbcm5719-llvm-cd79d0f5f36332bcc9ad5c70c314dcbad4f8886d.tar.gz
bcm5719-llvm-cd79d0f5f36332bcc9ad5c70c314dcbad4f8886d.zip
experimental: avoid using raw _WIN32 in filesystem
Use the _LIBCPP_WIN32API macro instead of _WIN32 checks. Fix a missed renaming for style conformance. llvm-svn: 293543
Diffstat (limited to 'libcxx/src')
-rw-r--r--libcxx/src/experimental/filesystem/directory_iterator.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/libcxx/src/experimental/filesystem/directory_iterator.cpp b/libcxx/src/experimental/filesystem/directory_iterator.cpp
index c8d52460b99..8c9d05c2f33 100644
--- a/libcxx/src/experimental/filesystem/directory_iterator.cpp
+++ b/libcxx/src/experimental/filesystem/directory_iterator.cpp
@@ -8,7 +8,8 @@
//===----------------------------------------------------------------------===//
#include "experimental/filesystem"
-#if defined(_WIN32)
+#include "__config"
+#if defined(_LIBCPP_WIN32API)
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#else
@@ -20,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL_FILESYSTEM
namespace { namespace detail {
-#if !defined(_WIN32)
+#if !defined(_LIBCPP_WIN32API)
inline error_code capture_errno() {
_LIBCPP_ASSERT(errno, "Expected errno to be non-zero");
return error_code{errno, std::generic_category()};
@@ -40,7 +41,7 @@ inline bool set_or_throw(std::error_code& my_ec,
return false;
}
-#if !defined(_WIN32)
+#if !defined(_LIBCPP_WIN32API)
inline path::string_type posix_readdir(DIR *dir_stream, error_code& ec) {
struct dirent* dir_entry_ptr = nullptr;
errno = 0; // zero errno in order to detect errors
@@ -58,7 +59,7 @@ inline path::string_type posix_readdir(DIR *dir_stream, error_code& ec) {
using detail::set_or_throw;
-#if defined(_WIN32)
+#if defined(_LIBCPP_WIN32API)
class __dir_stream {
public:
__dir_stream() = delete;
@@ -67,7 +68,7 @@ public:
__dir_stream(__dir_stream&& __ds) noexcept
: __stream_(__ds.__stream_), __root_(std::move(__ds.__root_)),
__entry_(std::move(__ds.__entry_)) {
- ds.__stream_ = INVALID_HANDLE_VALUE;
+ __ds.__stream_ = INVALID_HANDLE_VALUE;
}
__dir_stream(const path& root, directory_options opts, error_code& ec)
OpenPOWER on IntegriCloud