Restore an RB_COLOR macro, for the benefit of

a bit of DIAGNOSTIC code that depends on it.

Reported by:	rpokala, mjguzik
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D25204
This commit is contained in:
dougm 2020-06-10 02:50:25 +00:00 committed by Sebastian Huber
parent 5b29be92e3
commit e83aad1851
1 changed files with 6 additions and 0 deletions

View File

@ -333,6 +333,12 @@ struct { \
#define RB_TRUE 1
#define RB_FALSE 0
/* For debugging support */
#define RB_COLOR(elm, field) (RB_PARENT(elm, field) == NULL ? RB_FALSE : \
RB_LEFT(RB_PARENT(elm, field), field) == elm ? \
RB_RED_LF(RB_PARENT(elm, field), field) : \
RB_RED_RT(RB_PARENT(elm, field), field)
/*
* Something to be invoked in a loop at the root of every modified subtree,
* from the bottom up to the root, to update augmented node data.