diff --git a/src/CanvasRenderingContext2d.cc b/src/CanvasRenderingContext2d.cc index 7075641..78e28e8 100755 --- a/src/CanvasRenderingContext2d.cc +++ b/src/CanvasRenderingContext2d.cc @@ -619,6 +619,8 @@ NAN_METHOD(Context2d::PutImageData) { if (dx < 0) sw += dx, sx -= dx, dx = 0; if (dy < 0) sh += dy, sy -= dy, dy = 0; // clamp width at canvas size + // Need to wrap std::min calls using parens to prevent macro expansion on + // windows. See http://stackoverflow.com/questions/5004858/stdmin-gives-error cols = (std::min)(sw, context->canvas()->width - dx); rows = (std::min)(sh, context->canvas()->height - dy); break;