]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: errors: allow empty va_args for diag variadic macro
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 31 May 2021 12:26:20 +0000 (14:26 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 7 Jun 2021 14:58:15 +0000 (16:58 +0200)
Use the '##' operator to allow the usage of HA_DIAG_WARNING_COND macro
without extra arguments.

This must be backported up to 2.4.

include/haproxy/errors.h

index 4ece6e5556524ccc31173f436dc6caf50b3eeaab..a3614b7f0c131e9e1408249739ab9c37ccb26d57 100644 (file)
@@ -88,7 +88,7 @@ void ha_diag_warning(const char *fmt, ...)
 #define HA_DIAG_WARNING_COND(cond, fmt, ...)                  \
        do {                                                  \
                if ((global.mode & MODE_DIAG) && (cond))      \
-                       _ha_diag_warning((fmt), __VA_ARGS__); \
+                       _ha_diag_warning((fmt), ##__VA_ARGS__); \
        } while (0)
 
 /*