aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--AUTHORS1
-rw-r--r--include/core/SkPostConfig.h2
-rw-r--r--src/ports/SkOSFile_win.cpp16
-rw-r--r--src/utils/win/SkHRESULT.cpp2
4 files changed, 10 insertions, 11 deletions
diff --git a/AUTHORS b/AUTHORS
index 4bef9330ed..0e8abcc940 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -16,6 +16,7 @@ ARM <*@arm.com>
George Wright <george@mozilla.com>
Google Inc. <*@google.com>
Intel <*@intel.com>
+Jacek Caban <cjacek@gmail.com>
NVIDIA <*@nvidia.com>
Samsung <*@samsung.com>
The Chromium Authors <*@chromium.org>
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index dc76522ac1..8f62a70987 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -374,7 +374,7 @@
//////////////////////////////////////////////////////////////////////
#ifndef SK_ATOMICS_PLATFORM_H
-# if defined(SK_BUILD_FOR_WIN)
+# if defined(_MSC_VER)
# define SK_ATOMICS_PLATFORM_H "../../src/ports/SkAtomics_win.h"
# elif defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
# define SK_ATOMICS_PLATFORM_H "../../src/ports/SkAtomics_android.h"
diff --git a/src/ports/SkOSFile_win.cpp b/src/ports/SkOSFile_win.cpp
index 7fec557987..a0848915ba 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);
diff --git a/src/utils/win/SkHRESULT.cpp b/src/utils/win/SkHRESULT.cpp
index 32d9d4c35c..111cb761bd 100644
--- a/src/utils/win/SkHRESULT.cpp
+++ b/src/utils/win/SkHRESULT.cpp
@@ -7,7 +7,7 @@
#include "SkTypes.h"
-#include "SKHRESULT.h"
+#include "SkHRESULT.h"
void SkTraceHR(const char* file, unsigned long line,
HRESULT hr, const char* msg) {