MINOR: compiler: add a new __decl_thread_var() macro to declare local variables
authorWilly Tarreau <w@1wt.eu>
Wed, 12 Mar 2025 17:08:12 +0000 (18:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Mar 2025 10:38:00 +0000 (11:38 +0100)
commit69a3563ec82d5d19f3f106274a7df6b96049a594
tree0c3c5e8dc6d87092153182822769acc02e94382b
parent271a47be8ce29a9a40bf92d8ef1156405fdb5fd8
MINOR: compiler: add a new __decl_thread_var() macro to declare local variables

__decl_thread() already exists but is more suited for struct members.
When using it in a variables block, it appends the final trailing
semi-colon which is a statement that ends the variable block. Better
clean this up and have one precisely for variable blocks. In this
case we can simply define an unused enum value that will consume the
semi-colon. That's what the new macro __decl_thread_var() does.

(cherry picked from commit 69ac4cd315f05c69f3c34f824ef4e7f3221966cf)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit f7f2c888b113a3789a4c794f3380c8696e3bbf31)
Signed-off-by: Willy Tarreau <w@1wt.eu>
include/haproxy/compiler.h