[PATCH 07/11] Restore an RB_COLOR macro, for the benefit of

Sebastian Huber <[email protected]>
Newsgroups gmane.comp.lib.newlib
Message-ID <[email protected]>
From: dougm <[email protected]>

a bit of DIAGNOSTIC code that depends on it.

Reported by:	rpokala, mjguzik
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D25204
---
 newlib/libc/include/sys/tree.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/newlib/libc/include/sys/tree.h b/newlib/libc/include/sys/tree.h
index 29b731822..7c2053981 100644
--- a/newlib/libc/include/sys/tree.h
+++ b/newlib/libc/include/sys/tree.h
@@ -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.
-- 
2.26.2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.