Add some underscores in a few of our llist macros to reduce name collisions.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Sean Bright
2012-03-08 17:00:22 +00:00
parent 587cb230b2
commit a8116350bc

View File

@@ -747,24 +747,24 @@ struct { \
* \param sortfield Name of the field on which the list is sorted * \param sortfield Name of the field on which the list is sorted
* \since 1.6.1 * \since 1.6.1
*/ */
#define AST_LIST_INSERT_SORTALPHA(head, elm, field, sortfield) do { \ #define AST_LIST_INSERT_SORTALPHA(head, elm, field, sortfield) do { \
if (!(head)->first) { \ if (!(head)->first) { \
(head)->first = (elm); \ (head)->first = (elm); \
(head)->last = (elm); \ (head)->last = (elm); \
} else { \ } else { \
typeof((head)->first) cur = (head)->first, prev = NULL; \ typeof((head)->first) __cur = (head)->first, __prev = NULL; \
while (cur && strcmp(cur->sortfield, elm->sortfield) < 0) { \ while (__cur && strcmp(__cur->sortfield, elm->sortfield) < 0) { \
prev = cur; \ __prev = __cur; \
cur = cur->field.next; \ __cur = __cur->field.next; \
} \ } \
if (!prev) { \ if (!__prev) { \
AST_LIST_INSERT_HEAD(head, elm, field); \ AST_LIST_INSERT_HEAD(head, elm, field); \
} else if (!cur) { \ } else if (!__cur) { \
AST_LIST_INSERT_TAIL(head, elm, field); \ AST_LIST_INSERT_TAIL(head, elm, field); \
} else { \ } else { \
AST_LIST_INSERT_AFTER(head, prev, elm, field); \ AST_LIST_INSERT_AFTER(head, __prev, elm, field); \
} \ } \
} \ } \
} while (0) } while (0)
#define AST_RWLIST_INSERT_SORTALPHA AST_LIST_INSERT_SORTALPHA #define AST_RWLIST_INSERT_SORTALPHA AST_LIST_INSERT_SORTALPHA
@@ -830,14 +830,14 @@ struct { \
* This macro is safe to call on an empty list. * This macro is safe to call on an empty list.
*/ */
#define AST_LIST_REMOVE_HEAD(head, field) ({ \ #define AST_LIST_REMOVE_HEAD(head, field) ({ \
typeof((head)->first) cur = (head)->first; \ typeof((head)->first) __cur = (head)->first; \
if (cur) { \ if (__cur) { \
(head)->first = cur->field.next; \ (head)->first = __cur->field.next; \
cur->field.next = NULL; \ __cur->field.next = NULL; \
if ((head)->last == cur) \ if ((head)->last == __cur) \
(head)->last = NULL; \ (head)->last = NULL; \
} \ } \
cur; \ __cur; \
}) })
#define AST_RWLIST_REMOVE_HEAD AST_LIST_REMOVE_HEAD #define AST_RWLIST_REMOVE_HEAD AST_LIST_REMOVE_HEAD