]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: threads/atomic: rename local variables in macros to avoid conflicts
authorWilly Tarreau <w@1wt.eu>
Tue, 18 Jul 2017 12:20:41 +0000 (14:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 20 Nov 2017 19:45:38 +0000 (20:45 +0100)
[ plock commit bfac5887ebabb8ef753b0351f162265767eb219b ]

Local variable "t" was renamed "__pl_t" to limit the risk of conflicts
with existing variables in application code.

include/import/atomic-ops.h

index ae2c075c1d77e25413b729f3410637c4ba455f7e..9ee7da7767493cbd9b802d1077a0e031770cc3e5 100644 (file)
@@ -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