[libcxx] r293449 - experimental: tolerate the existence of a `__deref` macro
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Sun Jan 29 16:15:48 PST 2017
Author: compnerd
Date: Sun Jan 29 18:15:47 2017
New Revision: 293449
URL: http://llvm.org/viewvc/llvm-project?rev=293449&view=rev
Log:
experimental: tolerate the existence of a `__deref` macro
Microsoft's SAL has a `__deref` macro which results in a compilation
failure when building the filesystem module on Windows. Rename the
member function internally to avoid the conflict.
Modified:
libcxx/trunk/include/experimental/filesystem
libcxx/trunk/src/experimental/filesystem/directory_iterator.cpp
Modified: libcxx/trunk/include/experimental/filesystem
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/filesystem?rev=293449&r1=293448&r2=293449&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/filesystem (original)
+++ libcxx/trunk/include/experimental/filesystem Sun Jan 29 18:15:47 2017
@@ -1924,7 +1924,7 @@ public:
const directory_entry& operator*() const {
_LIBCPP_ASSERT(__imp_, "The end iterator cannot be dereferenced");
- return __deref();
+ return __dereference();
}
const directory_entry* operator->() const
@@ -1949,11 +1949,14 @@ private:
// construct the dir_stream
_LIBCPP_FUNC_VIS
- directory_iterator(const path&, error_code *, directory_options = directory_options::none);
+ directory_iterator(const path&, error_code *,
+ directory_options = directory_options::none);
+
_LIBCPP_FUNC_VIS
directory_iterator& __increment(error_code * __ec = nullptr);
+
_LIBCPP_FUNC_VIS
- const directory_entry& __deref() const;
+ const directory_entry& __dereference() const;
private:
shared_ptr<__dir_stream> __imp_;
@@ -2036,11 +2039,11 @@ public:
_LIBCPP_INLINE_VISIBILITY
const directory_entry& operator*() const
- { return __deref(); }
+ { return __dereference(); }
_LIBCPP_INLINE_VISIBILITY
const directory_entry* operator->() const
- { return &__deref(); }
+ { return &__dereference(); }
recursive_directory_iterator& operator++()
{ return __increment(); }
@@ -2079,7 +2082,7 @@ private:
error_code *__ec);
_LIBCPP_FUNC_VIS
- const directory_entry& __deref() const;
+ const directory_entry& __dereference() const;
_LIBCPP_FUNC_VIS
bool __try_recursion(error_code* __ec);
Modified: libcxx/trunk/src/experimental/filesystem/directory_iterator.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/experimental/filesystem/directory_iterator.cpp?rev=293449&r1=293448&r2=293449&view=diff
==============================================================================
--- libcxx/trunk/src/experimental/filesystem/directory_iterator.cpp (original)
+++ libcxx/trunk/src/experimental/filesystem/directory_iterator.cpp Sun Jan 29 18:15:47 2017
@@ -136,7 +136,7 @@ directory_iterator& directory_iterator::
}
-directory_entry const& directory_iterator::__deref() const {
+directory_entry const& directory_iterator::__dereference() const {
_LIBCPP_ASSERT(__imp_, "Attempting to dereference an invalid iterator");
return __imp_->__entry_;
}
@@ -182,7 +182,7 @@ int recursive_directory_iterator::depth(
return __imp_->__stack_.size() - 1;
}
-const directory_entry& recursive_directory_iterator::__deref() const {
+const directory_entry& recursive_directory_iterator::__dereference() const {
return __imp_->__stack_.top().__entry_;
}
More information about the cfe-commits
mailing list