aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-31 18:52:31 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-31 18:52:31 +0000
commitf3f2d1619e34deb6a1a8cf623f432927e09d0d3c (patch)
tree59931fbd121cf7fb79079efeb853f4036c32bfb2
parentb6bd24d31f56622d3fb06eca2aa9ed0d8c52457b (diff)
set nominmax on windows
R=scroggo@google.com Review URL: https://codereview.chromium.org/20990007 git-svn-id: http://skia.googlecode.com/svn/trunk@10470 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--bench/TimerData.cpp11
-rw-r--r--include/core/SkPostConfig.h10
-rw-r--r--src/utils/win/SkWGL_win.cpp2
3 files changed, 16 insertions, 7 deletions
diff --git a/bench/TimerData.cpp b/bench/TimerData.cpp
index 18d41e4de1..3b4baacfcd 100644
--- a/bench/TimerData.cpp
+++ b/bench/TimerData.cpp
@@ -20,16 +20,15 @@ TimerData::TimerData(const SkString& perIterTimeFormat, const SkString& normalTi
, fTruncatedCpuStr(" Cmsecs = ")
, fGpuStr(" gmsecs = ")
, fWallSum(0.0)
-, fWallMin((numeric_limits<double>::max)()) // Extra parens to make the windows build work, due to
- // 'max' macro
+, fWallMin(numeric_limits<double>::max())
, fTruncatedWallSum(0.0)
-, fTruncatedWallMin((numeric_limits<double>::max)())
+, fTruncatedWallMin(numeric_limits<double>::max())
, fCpuSum(0.0)
-, fCpuMin((numeric_limits<double>::max)())
+, fCpuMin(numeric_limits<double>::max())
, fTruncatedCpuSum(0.0)
-, fTruncatedCpuMin((numeric_limits<double>::max)())
+, fTruncatedCpuMin(numeric_limits<double>::max())
, fGpuSum(0.0)
-, fGpuMin((numeric_limits<double>::max)())
+, fGpuMin(numeric_limits<double>::max())
, fPerIterTimeFormat(perIterTimeFormat)
, fNormalTimeFormat(normalTimeFormat)
{}
diff --git a/include/core/SkPostConfig.h b/include/core/SkPostConfig.h
index 39d4eb73ab..022757554c 100644
--- a/include/core/SkPostConfig.h
+++ b/include/core/SkPostConfig.h
@@ -140,13 +140,23 @@
#define WIN32_LEAN_AND_MEAN
#define WIN32_IS_MEAN_WAS_LOCALLY_DEFINED
#endif
+ #ifndef NOMINMAX
+ #define NOMINMAX
+ #define NOMINMAX_WAS_LOCALLY_DEFINED
+ #endif
#include <windows.h>
#ifdef WIN32_IS_MEAN_WAS_LOCALLY_DEFINED
+ #undef WIN32_IS_MEAN_WAS_LOCALLY_DEFINED
#undef WIN32_LEAN_AND_MEAN
#endif
+ #ifdef NOMINMAX_WAS_LOCALLY_DEFINED
+ #undef NOMINMAX_WAS_LOCALLY_DEFINED
+ #undef NOMINMAX
+ #endif
+
#ifndef SK_DEBUGBREAK
#define SK_DEBUGBREAK(cond) do { if (!(cond)) { SkNO_RETURN_HINT(); __debugbreak(); }} while (false)
#endif
diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp
index f20262b818..4b3b3e63ae 100644
--- a/src/utils/win/SkWGL_win.cpp
+++ b/src/utils/win/SkWGL_win.cpp
@@ -312,7 +312,7 @@ HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, bool preferCoreProfile) {
unsigned int num;
int formats[64];
extensions.choosePixelFormat(dc, msaaIAttrs, fAttrs, 64, formats, &num);
- num = min(num,64);
+ num = SkTMin(num, 64U);
int formatToTry = extensions.selectFormat(formats,
num,
dc,