win: remove use of min() macro in pipe.c

This macro is not guaranteed to be present in stdlib.h and the
macro may be disabled on Windows in some situations (e.g. when
NOMINMAX is defined).

PR-URL: https://github.com/libuv/libuv/pull/1891
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
This commit is contained in:
Peter Johnson 2018-06-17 19:05:25 -07:00 committed by cjihrig
parent 0802c81966
commit 4e2fec16b7
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5

View File

@ -1658,7 +1658,8 @@ static DWORD uv__pipe_read_data(uv_loop_t* loop,
* (a) the length of the user-allocated buffer.
* (b) the maximum data length as specified by the `max_bytes` argument.
*/
max_bytes = min(buf.len, max_bytes);
if (max_bytes > buf.len)
max_bytes = buf.len;
/* Read into the user buffer. */
if (!ReadFile(handle->handle, buf.base, max_bytes, &bytes_read, NULL)) {