From: Willy Tarreau Date: Sun, 13 Nov 2022 11:14:10 +0000 (+0100) Subject: BUILD: debug: remove unnecessary quotes in HA_WEAK() calls X-Git-Tag: v2.7-dev9~107 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eedcea8b900b2397cbfcfe54f458f7fe1bbe6b35;p=thirdparty%2Fhaproxy.git BUILD: debug: remove unnecessary quotes in HA_WEAK() calls 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. --- diff --git a/include/haproxy/bug.h b/include/haproxy/bug.h index 54b41ee421..54536ff860 100644 --- a/include/haproxy/bug.h +++ b/include/haproxy/bug.h @@ -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); \ diff --git a/include/haproxy/pool.h b/include/haproxy/pool.h index 1af32ae04d..8fd14b9662 100644 --- a/include/haproxy/pool.h +++ b/include/haproxy/pool.h @@ -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); \