public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Restore an RB_COLOR macro, for the benefit of
@ 2020-10-26 13:32 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2020-10-26 13:32 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e83aad1851e8fa453c53e1663141f48014ea4a7c

commit e83aad1851e8fa453c53e1663141f48014ea4a7c
Author: dougm <dougm@FreeBSD.org>
Date:   Wed Jun 10 02:50:25 2020 +0000

    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

Diff:
---
 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.


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-26 13:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-26 13:32 [newlib-cygwin] Restore an RB_COLOR macro, for the benefit of Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).