public inbox for newlib-cvs@sourceware.org help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org> To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Restore an RB_COLOR macro, for the benefit of Date: Mon, 26 Oct 2020 13:32:23 +0000 (GMT) [thread overview] Message-ID: <20201026133223.0568B3850412@sourceware.org> (raw) 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.
reply other threads:[~2020-10-26 13:32 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20201026133223.0568B3850412@sourceware.org \ --to=sh@sourceware.org \ --cc=newlib-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).