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:
parent
0802c81966
commit
4e2fec16b7
@ -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)) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user