]> git.kaiwu.me - haproxy.git/commit
BUILD: quic: use _MAX() to avoid build issues in pools declarations
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Aug 2025 17:10:11 +0000 (19:10 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 6 Aug 2025 17:19:11 +0000 (19:19 +0200)
commit2ce0c63206a15a3f530b18839d373282deba37e5
tree113ac39285a32902947ece8181e54356afb1496b
parentcf8871ae40ae85f86b0d396b6af1eb657134ffc1
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