summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-06 06:02:07 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-06 06:02:07 +0000
commit476d2f769e6bf008b07f5130ca68a4930434d996 (patch)
treebeaf76484e399d4a6aa9e4d200ecfe6fe924e231
parent753cbbbd3ce28253f381caff83ce2a7f6e08785b (diff)
downloadllvm-476d2f769e6bf008b07f5130ca68a4930434d996.tar.gz
llvm-476d2f769e6bf008b07f5130ca68a4930434d996.tar.bz2
llvm-476d2f769e6bf008b07f5130ca68a4930434d996.tar.xz
Support/Windows: Make MinGW happy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120991 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Support/Windows/PathV2.inc2
-rw-r--r--lib/Support/Windows/Windows.h12
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/Support/Windows/PathV2.inc b/lib/Support/Windows/PathV2.inc
index 49343dc616..c724607453 100644
--- a/lib/Support/Windows/PathV2.inc
+++ b/lib/Support/Windows/PathV2.inc
@@ -118,7 +118,7 @@ namespace {
return ::CryptReleaseContext(Provider, 0);
}
- typedef ScopedHandle<HCRYPTPROV, HCRYPTPROV(INVALID_HANDLE_VALUE),
+ typedef ScopedHandle<HCRYPTPROV, uintptr_t(-1),
BOOL (WINAPI*)(HCRYPTPROV), CryptReleaseContext>
ScopedCryptContext;
bool is_separator(const wchar_t value) {
diff --git a/lib/Support/Windows/Windows.h b/lib/Support/Windows/Windows.h
index 9ee9d1fc8e..12ddc92e7c 100644
--- a/lib/Support/Windows/Windows.h
+++ b/lib/Support/Windows/Windows.h
@@ -59,7 +59,7 @@ public:
}
};
-template <class HandleType, HandleType InvalidHandle,
+template <class HandleType, uintptr_t InvalidHandle,
class DeleterType, DeleterType D>
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<HANDLE, INVALID_HANDLE_VALUE,
+typedef ScopedHandle<HANDLE, uintptr_t(-1),
BOOL (WINAPI*)(HANDLE), ::FindClose>
ScopedFindHandle;