summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/util.h b/src/common/util.h
index 2155a3a06a..093fd73c1c 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -149,10 +149,11 @@ char *smartlist_join_strings(smartlist_t *sl, const char *join, int terminate);
#define SMARTLIST_FOREACH(sl, type, var, cmd) \
do { \
- int sl_idx, sl_len=smartlist_len(sl); \
+ int var ## _sl_idx, var ## _sl_len=smartlist_len(sl); \
type var; \
- for(sl_idx = 0; sl_idx < sl_len; ++sl_idx) { \
- var = smartlist_get((sl),sl_idx); \
+ for(var ## _sl_idx = 0; var ## _sl_idx < var ## _sl_len; \
+ ++var ## _sl_idx) { \
+ var = smartlist_get((sl),var ## _sl_idx); \
do {cmd;} while(0); \
} } while (0)