summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Windows
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
commit0d025b6b42111f1ebab71ea000172dfe821551b6 (patch)
tree12d05995581c97ba5468b1ec4f135217acf8f606 /llvm/lib/Support/Windows
parent622114cfe3c7a2a4daf4edc2d2556200cbd1ee9d (diff)
downloadbcm5719-llvm-0d025b6b42111f1ebab71ea000172dfe821551b6.tar.gz
bcm5719-llvm-0d025b6b42111f1ebab71ea000172dfe821551b6.zip
Support/Windows: Make MinGW happy.
llvm-svn: 120991
Diffstat (limited to 'llvm/lib/Support/Windows')
-rw-r--r--llvm/lib/Support/Windows/PathV2.inc2
-rw-r--r--llvm/lib/Support/Windows/Windows.h12
2 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Support/Windows/PathV2.inc b/llvm/lib/Support/Windows/PathV2.inc
index 49343dc6161..c724607453d 100644
--- a/llvm/lib/Support/Windows/PathV2.inc
+++ b/llvm/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/llvm/lib/Support/Windows/Windows.h b/llvm/lib/Support/Windows/Windows.h
index 9ee9d1fc8e6..12ddc92e7ca 100644
--- a/llvm/lib/Support/Windows/Windows.h
+++ b/llvm/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;
OpenPOWER on IntegriCloud