summaryrefslogtreecommitdiffstats
path: root/lib/id_alloc.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2018-11-14 20:04:55 +0100
committerMark Stapp <mjs@voltanet.io>2018-11-14 20:04:55 +0100
commit4a600b08f7359e492211c25b5a5a21998f034e32 (patch)
treefbe105fecfa4893bb2a2ff6846519e63f692e488 /lib/id_alloc.c
parentMerge pull request #3322 from qlyoung/remove-vestigial-secondary (diff)
downloadfrr-4a600b08f7359e492211c25b5a5a21998f034e32.tar.xz
frr-4a600b08f7359e492211c25b5a5a21998f034e32.zip
libs: rename two id_alloc macros to resolve bsd conflict
Two of the macros in lib/id_alloc had conflicts on some platforms; rename them to be unique. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'lib/id_alloc.c')
-rw-r--r--lib/id_alloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/id_alloc.c b/lib/id_alloc.c
index b4d37dbdc..222ba651b 100644
--- a/lib/id_alloc.c
+++ b/lib/id_alloc.c
@@ -42,7 +42,7 @@ DEFINE_MTYPE_STATIC(LIB, IDALLOC_POOL, "ID Number temporary holding pool entry")
#define DIR_MASK ((1<<IDALLOC_DIR_BITS)-1)
#define SUBDIR_MASK ((1<<IDALLOC_SUBDIR_BITS)-1)
-#define PAGE_MASK ((1<<IDALLOC_PAGE_BITS)-1)
+#define FRR_ID_PAGE_MASK ((1<<IDALLOC_PAGE_BITS)-1)
#define WORD_MASK ((1<<IDALLOC_WORD_BITS)-1)
#define OFFSET_MASK ((1<<IDALLOC_OFFSET_BITS)-1)
@@ -50,13 +50,13 @@ DEFINE_MTYPE_STATIC(LIB, IDALLOC_POOL, "ID Number temporary holding pool entry")
IDALLOC_PAGE_BITS + IDALLOC_SUBDIR_BITS)
#define SUBDIR_SHIFT (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS + \
IDALLOC_PAGE_BITS)
-#define PAGE_SHIFT (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS)
+#define FRR_ID_PAGE_SHIFT (IDALLOC_OFFSET_BITS + IDALLOC_WORD_BITS)
#define WORD_SHIFT (IDALLOC_OFFSET_BITS)
#define OFFSET_SHIFT (0)
#define ID_DIR(id) ((id >> DIR_SHIFT) & DIR_MASK)
#define ID_SUBDIR(id) ((id >> SUBDIR_SHIFT) & SUBDIR_MASK)
-#define ID_PAGE(id) ((id >> PAGE_SHIFT) & PAGE_MASK)
+#define ID_PAGE(id) ((id >> FRR_ID_PAGE_SHIFT) & FRR_ID_PAGE_MASK)
#define ID_WORD(id) ((id >> WORD_SHIFT) & WORD_MASK)
#define ID_OFFSET(id) ((id >> OFFSET_SHIFT) & OFFSET_MASK)
@@ -98,7 +98,7 @@ static struct id_alloc_page *find_or_create_page(struct id_alloc *alloc,
page->base_value = id;
subdir->sublevels[ID_PAGE(id)] = page;
- alloc->capacity += 1 << PAGE_SHIFT;
+ alloc->capacity += 1 << FRR_ID_PAGE_SHIFT;
page->next_has_free = alloc->has_free;
alloc->has_free = page;
} else if (page != NULL && create) {