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 54b41ee..54536ff 100644
--- a/include/haproxy/bug.h
+++ b/include/haproxy/bug.h
@@ -273,8 +273,8 @@
.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 @@
.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 @@
.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 @@
.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 @@
.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 @@
.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 1af32ae..8fd14b9 100644
--- a/include/haproxy/pool.h
+++ b/include/haproxy/pool.h
@@ -263,8 +263,8 @@
}, \
}; \
_.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 @@
}, \
}; \
_.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 @@
}, \
}; \
_.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); \