From 56d968c47a983a37b8b99298c9a17456f9653245 Mon Sep 17 00:00:00 2001 From: JayXon Date: Sun, 24 Apr 2016 00:14:58 -0700 Subject: [PATCH] Avoid min name conflict In some weird C implementations (MSVC), min is defined as (((a) < (b)) ? (a) : (b)) --- src/zopfli/squeeze.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zopfli/squeeze.c b/src/zopfli/squeeze.c index d7cd9bf4..a695c18c 100644 --- a/src/zopfli/squeeze.c +++ b/src/zopfli/squeeze.c @@ -197,7 +197,7 @@ static double GetCostModelMinCost(CostModelFun* costmodel, void* costcontext) { return costmodel(bestlength, bestdist, costcontext); } -static size_t min(size_t a, size_t b) { +static size_t zopfli_min(size_t a, size_t b) { return a < b ? a : b; } @@ -283,7 +283,7 @@ static double GetBestLengths(ZopfliBlockState *s, } } /* Lengths. */ - kend = min(leng, inend-i); + kend = zopfli_min(leng, inend-i); mincostaddcostj = mincost + costs[j]; for (k = 3; k <= kend; k++) { double newCost;