summaryrefslogtreecommitdiff
path: root/lib/Support/Windows/Windows.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Windows/Windows.h')
-rw-r--r--lib/Support/Windows/Windows.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Support/Windows/Windows.h b/lib/Support/Windows/Windows.h
index 5c1da0d617..2754075035 100644
--- a/lib/Support/Windows/Windows.h
+++ b/lib/Support/Windows/Windows.h
@@ -128,6 +128,24 @@ struct FindHandleTraits : CommonHandleTraits {
}
};
+struct FileMappingHandleTraits : CommonHandleTraits {
+ static handle_type GetInvalid() {
+ return 0;
+ }
+};
+
+struct MappedViewOfFileHandleTraits : CommonHandleTraits {
+ typedef LPVOID handle_type;
+
+ static handle_type GetInvalid() {
+ return 0;
+ }
+
+ static void Close(handle_type h) {
+ ::UnmapViewOfFile(h);
+ }
+};
+
struct FileHandleTraits : CommonHandleTraits {};
typedef ScopedHandle<CommonHandleTraits> ScopedCommonHandle;
@@ -135,6 +153,8 @@ typedef ScopedHandle<FileHandleTraits> ScopedFileHandle;
typedef ScopedHandle<CryptContextTraits> ScopedCryptContext;
typedef ScopedHandle<FindHandleTraits> ScopedFindHandle;
typedef ScopedHandle<JobHandleTraits> ScopedJobHandle;
+typedef ScopedHandle<FileMappingHandleTraits> ScopedFileMappingHandle;
+typedef ScopedHandle<MappedViewOfFileHandleTraits> ScopedMappedViewOfFileHandle;
namespace llvm {
template <class T>