Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: src/ports/SkOSFile_win.cpp

Issue 198643004: Fixed cross compilation with mingw. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Patchset with AUTHORS change Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkPostConfig.h ('k') | src/utils/win/SkHRESULT.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkOSFile_win.cpp
diff --git a/src/ports/SkOSFile_win.cpp b/src/ports/SkOSFile_win.cpp
index 7fec557987e307d6faae0789aea88a04f51fc294..a0848915ba49e9fd6f8f34b25ba70ca3c003f41a 100644
--- a/src/ports/SkOSFile_win.cpp
+++ b/src/ports/SkOSFile_win.cpp
@@ -50,18 +50,16 @@ bool sk_fidentical(SkFILE* a, SkFILE* b) {
&& aID.fVolume == bID.fVolume;
}
-template <typename HandleType, HandleType InvalidValue, BOOL (WINAPI * Close)(HandleType)>
-class SkAutoTHandle : SkNoncopyable {
+class SkAutoNullKernelHandle : SkNoncopyable {
public:
- SkAutoTHandle(HandleType handle) : fHandle(handle) { }
- ~SkAutoTHandle() { Close(fHandle); }
- operator HandleType() { return fHandle; }
- bool isValid() { return InvalidValue != fHandle; }
+ SkAutoNullKernelHandle(const HANDLE handle) : fHandle(handle) { }
+ ~SkAutoNullKernelHandle() { CloseHandle(fHandle); }
+ operator HANDLE() const { return fHandle; }
+ bool isValid() const { return NULL != fHandle; }
private:
- HandleType fHandle;
+ HANDLE fHandle;
};
-typedef SkAutoTHandle<HANDLE, INVALID_HANDLE_VALUE, CloseHandle> SkAutoWinFile;
-typedef SkAutoTHandle<HANDLE, NULL, CloseHandle> SkAutoWinMMap;
+typedef SkAutoNullKernelHandle SkAutoWinMMap;
void sk_fmunmap(const void* addr, size_t) {
UnmapViewOfFile(addr);
« no previous file with comments | « include/core/SkPostConfig.h ('k') | src/utils/win/SkHRESULT.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698