diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc index 49343dc6161..c724607453d 100644 --- a/lib/Support/Windows/PathV2.inc +++ b/lib/Support/Windows/PathV2.inc @@ -118,7 +118,7 @@ namespace { return ::CryptReleaseContext(Provider, 0); } - typedef ScopedHandle ScopedCryptContext; bool is_separator(const wchar_t value) { diff --git a/lib/Support/Windows/Windows.h b/lib/Support/Windows/Windows.h index 9ee9d1fc8e6..12ddc92e7ca 100644 --- a/lib/Support/Windows/Windows.h +++ b/lib/Support/Windows/Windows.h @@ -59,7 +59,7 @@ public: } }; -template class ScopedHandle { HandleType Handle; @@ -69,13 +69,13 @@ public: ScopedHandle(HandleType handle) : Handle(handle) {} ~ScopedHandle() { - if (Handle != InvalidHandle) + if (Handle != HandleType(InvalidHandle)) D(Handle); } HandleType take() { HandleType temp = Handle; - Handle = InvalidHandle; + Handle = HandleType(InvalidHandle); return temp; } @@ -91,14 +91,14 @@ public: // True if Handle is valid. operator unspecified_bool_type() const { - return Handle == InvalidHandle ? 0 : unspecified_bool_true; + return Handle == HandleType(InvalidHandle) ? 0 : unspecified_bool_true; } bool operator!() const { - return Handle == InvalidHandle; + return Handle == HandleType(InvalidHandle); } }; -typedef ScopedHandle ScopedFindHandle;