From 2ce0c63206a15a3f530b18839d373282deba37e5 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 6 Aug 2025 19:10:11 +0200 Subject: [PATCH] BUILD: quic: use _MAX() to avoid build issues in pools declarations With the upcoming pool declaration, we're filling a struct's fields, while older versions were relying on initcalls which could be turned to function declarations. Thus the compound expressions that were usable there are not necessarily anymore, as witnessed here with gcc-5.5 on solaris 10: In file included from include/haproxy/quic_tx.h:26:0, from src/quic_tx.c:15: include/haproxy/compat.h:106:19: error: braced-group within expression allowed only inside a function #define MAX(a, b) ({ \ ^ include/haproxy/pool.h:41:11: note: in definition of macro '__REGISTER_POOL' .size = _size, \ ^ ... include/haproxy/quic_tx-t.h:6:29: note: in expansion of macro 'MAX' #define QUIC_MAX_CC_BUFSIZE MAX(QUIC_INITIAL_IPV6_MTU, QUIC_INITIAL_IPV4_MTU) Let's make the macro use _MAX() instead of MAX() since it relies on pure constants. --- include/haproxy/quic_tx-t.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/haproxy/quic_tx-t.h b/include/haproxy/quic_tx-t.h index a719abe29..606f65221 100644 --- a/include/haproxy/quic_tx-t.h +++ b/include/haproxy/quic_tx-t.h @@ -3,7 +3,7 @@ #define QUIC_MIN_CC_PKTSIZE 128 #define QUIC_DGRAM_HEADLEN (sizeof(uint16_t) + sizeof(void *)) -#define QUIC_MAX_CC_BUFSIZE MAX(QUIC_INITIAL_IPV6_MTU, QUIC_INITIAL_IPV4_MTU) +#define QUIC_MAX_CC_BUFSIZE _MAX(QUIC_INITIAL_IPV6_MTU, QUIC_INITIAL_IPV4_MTU) /* Sendmsg input buffer cannot be bigger than 65535 bytes. This comes from UDP * header which uses a 2-bytes length field. QUIC datagrams are limited to 1252 -- 2.47.3