aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-02-20 08:47:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-02-20 08:47:23 +0000
commita39669198f4b66aca26d5fc2612a6047cf439bb4 (patch)
tree9abce72387717a9ee84363204545800e2d13cff2
parent2c0c75e3454944ffb7eb3afef9c012c111331678 (diff)
we call the macro CURLMAX() isntead of MAX(), just because it turned up
it collides with another MAX define on some platforms (like netbsd 1.6.1)
-rw-r--r--lib/transfer.c8
-rw-r--r--lib/urldata.h7
2 files changed, 7 insertions, 8 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index e2e044938..148e9f08d 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -313,8 +313,8 @@ CURLcode Curl_readwrite(struct connectdata *conn,
if (k->hbuflen + nread >= data->state.headersize) {
/* We enlarge the header buffer as it is too small */
char *newbuff;
- long newsize=MAX((k->hbuflen+nread)*3/2,
- data->state.headersize*2);
+ long newsize=CURLMAX((k->hbuflen+nread)*3/2,
+ data->state.headersize*2);
hbufp_index = k->hbufp - data->state.headerbuff;
newbuff = (char *)realloc(data->state.headerbuff, newsize);
if(!newbuff) {
@@ -358,8 +358,8 @@ CURLcode Curl_readwrite(struct connectdata *conn,
if (k->hbuflen + full_length >=
data->state.headersize) {
char *newbuff;
- long newsize=MAX((k->hbuflen+full_length)*3/2,
- data->state.headersize*2);
+ long newsize=CURLMAX((k->hbuflen+full_length)*3/2,
+ data->state.headersize*2);
hbufp_index = k->hbufp - data->state.headerbuff;
newbuff = (char *)realloc(data->state.headerbuff, newsize);
if(!newbuff) {
diff --git a/lib/urldata.h b/lib/urldata.h
index 9b81e69a6..899e154f6 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -110,10 +110,9 @@
/* Maximum number of dirs supported by libcurl in a FTP dir hierarchy */
#define CURL_MAX_FTP_DIRDEPTH 100
-/* Just a convenience macro to get the larger value out of two given */
-#ifndef MAX
-#define MAX(x,y) ((x)>(y)?(x):(y))
-#endif
+/* Just a convenience macro to get the larger value out of two given.
+ We prefix with CURL to prevent name collisions. */
+#define CURLMAX(x,y) ((x)>(y)?(x):(y))
#ifdef HAVE_KRB4
/* Types needed for krb4-ftp connections */