diff --git a/src/include/lwip/def.h b/src/include/lwip/def.h index eba9b877..1f5d47f5 100644 --- a/src/include/lwip/def.h +++ b/src/include/lwip/def.h @@ -35,8 +35,8 @@ /* this might define NULL already */ #include "arch/cc.h" -#define LWIP_MAX(x , y) (x) > (y) ? (x) : (y) -#define LWIP_MIN(x , y) (x) < (y) ? (x) : (y) +#define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y)) +#define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y)) #ifndef NULL #define NULL ((void *)0) diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index a4121ce0..3dc313e8 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -610,7 +610,7 @@ * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. */ #ifndef TCP_SND_QUEUELEN -#define TCP_SND_QUEUELEN 4 * TCP_SND_BUF/TCP_MSS +#define TCP_SND_QUEUELEN (4 * (TCP_SND_BUF/TCP_MSS)) #endif /** @@ -619,7 +619,7 @@ * TCP snd_buf for select to return writable. */ #ifndef TCP_SNDLOWAT -#define TCP_SNDLOWAT TCP_SND_BUF/2 +#define TCP_SNDLOWAT (TCP_SND_BUF/2) #endif /** diff --git a/src/include/lwip/sockets.h b/src/include/lwip/sockets.h index 185beee2..d8d48c26 100644 --- a/src/include/lwip/sockets.h +++ b/src/include/lwip/sockets.h @@ -80,7 +80,7 @@ struct sockaddr { #define SO_OOBINLINE 0x0100 /* leave received OOB data in line */ #define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ -#define SO_DONTLINGER (int)(~SO_LINGER) +#define SO_DONTLINGER ((int)(~SO_LINGER)) /* * Additional options, not kept in so_options.