uhttpd: Fix compilation with gcc 6.4

This commit is contained in:
jbnadal
2018-10-25 15:38:30 +02:00
parent f53ccea520
commit 32918ded24
3 changed files with 4 additions and 4 deletions

View File

@@ -419,7 +419,7 @@ void client_poll_post_data(struct client *cl)
if (!d->data_send)
return;
cur_len = min(r->content_length, len);
cur_len = u_min(r->content_length, len);
if (cur_len) {
if (d->data_blocked)
break;

View File

@@ -176,7 +176,7 @@ uh_path_lookup(struct client *cl, const char *url)
/* create canon path */
len = strlen(uh_buf);
slash = len && uh_buf[len - 1] == '/';
len = min(len, sizeof(path_phys) - 1);
len = u_min(len, sizeof(path_phys) - 1);
for (i = len; i >= 0; i--) {
char ch = uh_buf[i];

View File

@@ -41,8 +41,8 @@ struct uh_addr {
};
};
#define min(x, y) (((x) < (y)) ? (x) : (y))
#define max(x, y) (((x) > (y)) ? (x) : (y))
#define u_min(x, y) (((x) < (y)) ? (x) : (y))
#define u_max(x, y) (((x) > (y)) ? (x) : (y))
#define array_size(x) \
(sizeof(x) / sizeof(x[0]))