From 9ff2ae36ec0633b8017612b13224447c716bbcc2 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Mon, 8 Jul 2013 15:06:25 +0300 Subject: Make min be MIN. --- io.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index dc41aea3..a1c902ba 100644 --- a/io.c +++ b/io.c @@ -3500,12 +3500,12 @@ get_a_record(char **out, /* pointer to pointer to data */ recm.rt_start = iop->off + recm.len; /* read more data, break if EOF */ -#ifndef min -#define min(x, y) (x < y ? x : y) +#ifndef MIN +#define MIN(x, y) (x < y ? x : y) #endif /* subtract one in read count to leave room for sentinel */ room_left = iop->end - iop->dataend - 1; - amt_to_read = min(iop->readsize, room_left); + amt_to_read = MIN(iop->readsize, room_left); if (amt_to_read < iop->readsize) { grow_iop_buffer(iop); @@ -3516,7 +3516,7 @@ get_a_record(char **out, /* pointer to pointer to data */ /* recalculate amt_to_read */ room_left = iop->end - iop->dataend - 1; - amt_to_read = min(iop->readsize, room_left); + amt_to_read = MIN(iop->readsize, room_left); } while (amt_to_read + iop->readsize < room_left) amt_to_read += iop->readsize; @@ -3526,7 +3526,7 @@ get_a_record(char **out, /* pointer to pointer to data */ * POSIX limits read to SSIZE_MAX. There are (bizarre) * systems where this amount is small. */ - amt_to_read = min(amt_to_read, SSIZE_MAX); + amt_to_read = MIN(amt_to_read, SSIZE_MAX); #endif iop->count = iop->public.read_func(iop->public.fd, iop->dataend, amt_to_read); -- cgit v1.2.3 From 0981cc089ea88f146a6c949146e73f88c1b295e9 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Wed, 24 Jul 2013 21:53:30 +0300 Subject: Fix compiling on MinGW. --- io.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index a1c902ba..59ddd115 100644 --- a/io.c +++ b/io.c @@ -185,10 +185,6 @@ #define INCREMENT_REC(X) X++ #endif -/* This is for fake directory file descriptors on systems that don't - allow to open() a directory. */ -#define FAKE_FD_VALUE 42 - typedef enum { CLOSE_ALL, CLOSE_TO, CLOSE_FROM } two_way_close_type; /* Several macros to make the code a bit clearer. */ -- cgit v1.2.3