From: Willy Tarreau Date: Tue, 18 Jul 2017 12:20:41 +0000 (+0200) Subject: MINOR: threads/atomic: rename local variables in macros to avoid conflicts X-Git-Tag: v1.8.0~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98409e34cab8df0285a7135348867ec7bc064c00;p=thirdparty%2Fhaproxy.git MINOR: threads/atomic: rename local variables in macros to avoid conflicts [ plock commit bfac5887ebabb8ef753b0351f162265767eb219b ] Local variable "t" was renamed "__pl_t" to limit the risk of conflicts with existing variables in application code. --- diff --git a/include/import/atomic-ops.h b/include/import/atomic-ops.h index ae2c075c1d..9ee7da7767 100644 --- a/include/import/atomic-ops.h +++ b/include/import/atomic-ops.h @@ -499,10 +499,10 @@ static inline void pl_cpu_relax() #define pl_sub(ptr, x) ({ __sync_sub_and_fetch((ptr), (x)); }) #define pl_xadd(ptr, x) ({ __sync_fetch_and_add((ptr), (x)); }) #define pl_cmpxchg(ptr, o, n) ({ __sync_val_compare_and_swap((ptr), (o), (n)); }) -#define pl_xchg(ptr, x) ({ typeof(*(ptr)) t; \ - do { t = *(ptr); \ - } while (!__sync_bool_compare_and_swap((ptr), t, (x))); \ - t; \ +#define pl_xchg(ptr, x) ({ typeof(*(ptr)) __pl_t; \ + do { __pl_t = *(ptr); \ + } while (!__sync_bool_compare_and_swap((ptr), __pl_t, (x))); \ + __pl_t; \ }) #endif