]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: debug: remove unnecessary quotes in HA_WEAK() calls
authorWilly Tarreau <w@1wt.eu>
Sun, 13 Nov 2022 11:14:10 +0000 (12:14 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Nov 2022 10:12:49 +0000 (11:12 +0100)
HA_WEAK() is supposed to take a symbol in argument, not a string, since
the asm statements it produces already quote the argument. Having it
quoted twice doesn't work on older compilers and was the only reason
why DEBUG_MEM_STATS didn't work on older compilers.

include/haproxy/bug.h
include/haproxy/pool.h

index 54b41ee421bbcd1596c42edf051a4ca66f295cdd..54536ff8605c59b446811be2124cce4c90b07de9 100644 (file)
@@ -273,8 +273,8 @@ struct mem_stats {
                        .func = __func__,                               \
                },                                                      \
        };                                                              \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        _HA_ATOMIC_INC(&_.calls);                                       \
        _HA_ATOMIC_ADD(&_.size, __x * __y);                             \
        calloc(__x,__y);                                                \
@@ -296,8 +296,8 @@ struct mem_stats {
                        .func = __func__,                               \
                },                                                      \
        };                                                              \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        if (__x) {                                                      \
                _HA_ATOMIC_INC(&_.calls);                               \
                _HA_ATOMIC_ADD(&_.size, __y);                           \
@@ -314,8 +314,8 @@ struct mem_stats {
                        .func = __func__,                               \
                },                                                      \
        };                                                              \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        if (__builtin_constant_p((x)) || __builtin_constant_p(*(x))) {  \
                HA_LINK_ERROR(call_to_ha_free_attempts_to_free_a_constant); \
        }                                                               \
@@ -335,8 +335,8 @@ struct mem_stats {
                        .func = __func__,                               \
                },                                                      \
        };                                                              \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        _HA_ATOMIC_INC(&_.calls);                                       \
        _HA_ATOMIC_ADD(&_.size, __x);                                   \
        malloc(__x);                                                    \
@@ -352,8 +352,8 @@ struct mem_stats {
                        .func = __func__,                               \
                },                                                      \
        };                                                              \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        _HA_ATOMIC_INC(&_.calls);                                       \
        _HA_ATOMIC_ADD(&_.size, __y);                                   \
        realloc(__x,__y);                                               \
@@ -369,8 +369,8 @@ struct mem_stats {
                        .func = __func__,                               \
                },                                                      \
        };                                                              \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        _HA_ATOMIC_INC(&_.calls);                                       \
        _HA_ATOMIC_ADD(&_.size, __y);                                   \
        strdup(__x);                                                    \
index 1af32ae04d682fe069b3743ba07b971ae4b6443d..8fd14b9662cd0ef17b9d52a1ffc0af2325036906 100644 (file)
@@ -263,8 +263,8 @@ static inline void *pool_get_from_cache(struct pool_head *pool, const void *call
                },                                                      \
        };                                                              \
        _.extra = __pool;                                               \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        if (__ptr)  {                                                   \
                _HA_ATOMIC_INC(&_.calls);                               \
                _HA_ATOMIC_ADD(&_.size, __pool->size);                  \
@@ -283,8 +283,8 @@ static inline void *pool_get_from_cache(struct pool_head *pool, const void *call
                },                                                      \
        };                                                              \
        _.extra = __pool;                                               \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        _HA_ATOMIC_INC(&_.calls);                                       \
        _HA_ATOMIC_ADD(&_.size, __x);                                   \
        __pool_alloc(__pool, 0);                                        \
@@ -301,8 +301,8 @@ static inline void *pool_get_from_cache(struct pool_head *pool, const void *call
                },                                                      \
        };                                                              \
        _.extra = __pool;                                               \
-       HA_WEAK("__start_mem_stats");                                   \
-       HA_WEAK("__stop_mem_stats");                                    \
+       HA_WEAK(__start_mem_stats);                                     \
+       HA_WEAK(__stop_mem_stats);                                      \
        _HA_ATOMIC_INC(&_.calls);                                       \
        _HA_ATOMIC_ADD(&_.size, __x);                                   \
        __pool_alloc(__pool, POOL_F_MUST_ZERO);                         \