Index: win32.h =================================================================== RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/win32.h,v retrieving revision 2.7 diff -u -p -r2.7 win32.h --- win32.h 2002/04/29 11:07:40 2.7 +++ win32.h 2002/10/30 00:09:45 @@ -31,6 +31,7 @@ #define WIN32_LEAN_AND_MEAN /* We want a minimum IE version of 3 */ #define _WIN32_IE 0x0300 +#define NOMINMAX #include #if HAVE_ALLOCA_H #include @@ -48,6 +49,11 @@ #include #include + +/* Replacements for min & max, which are too problematic + when used with libstdc++-v3 (gcc3) */ +#define MAXIMUM(a,b) ((a)>(b)?(a):(b)) +#define MINIMUM(a,b) ((a)<(b)?(a):(b)) /* =========================== */ #ifdef __cplusplus Index: compress_bz.cc =================================================================== RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/compress_bz.cc,v retrieving revision 2.5 diff -u -p -r2.5 compress_bz.cc --- compress_bz.cc 2002/06/27 11:48:42 2.5 +++ compress_bz.cc 2002/10/30 00:12:48 @@ -73,7 +73,7 @@ compress_bz::read (void *buffer, size_t if (peeklen) { - ssize_t tmplen = min (peeklen, len); + ssize_t tmplen = MINIMUM (peeklen, len); peeklen -= tmplen; memcpy (buffer, peekbuf, tmplen); memmove (peekbuf, peekbuf + tmplen, tmplen); Index: compress_gz.cc =================================================================== RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/compress_gz.cc,v retrieving revision 2.6 diff -u -p -r2.6 compress_gz.cc --- compress_gz.cc 2002/07/05 01:59:34 2.6 +++ compress_gz.cc 2002/10/30 00:13:01 @@ -230,7 +230,7 @@ compress_gz::read (void *buffer, size_t if (peeklen) { - ssize_t tmplen = min (peeklen, len); + ssize_t tmplen = MINIMUM (peeklen, len); peeklen -= tmplen; memcpy (buffer, peekbuf, tmplen); memmove (peekbuf, peekbuf + tmplen, tmplen); Index: archive_tar_file.cc =================================================================== RCS file: /home/max/cvsmirror/cygwin-apps-cvs/setup/archive_tar_file.cc,v retrieving revision 2.5 diff -u -p -r2.5 archive_tar_file.cc --- archive_tar_file.cc 2002/05/05 04:02:00 2.5 +++ archive_tar_file.cc 2002/10/30 00:33:24 @@ -45,7 +45,7 @@ ssize_t archive_tar_file::read (void *bu { /* how many bytes do we want to give the user */ int - want = min (len, state.file_length - state.file_offset); + want = MINIMUM (len, state.file_length - state.file_offset); /* how many do we need to read after that to line up the file pointer */ int roundup = (512 - (want % 512)) % 512; @@ -84,7 +84,7 @@ ssize_t archive_tar_file::write (const v ssize_t archive_tar_file::peek (void *buffer, size_t len) { int - want = min (len, state.file_length - state.file_offset); + want = MINIMUM (len, state.file_length - state.file_offset); if (want) { ssize_t