From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 0568B3850412; Mon, 26 Oct 2020 13:32:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0568B3850412 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Restore an RB_COLOR macro, for the benefit of X-Act-Checkin: newlib-cygwin X-Git-Author: dougm X-Git-Refname: refs/heads/master X-Git-Oldrev: 5b29be92e3267109c3cb48d22fa9e0f09aa9d150 X-Git-Newrev: e83aad1851e8fa453c53e1663141f48014ea4a7c Message-Id: <20201026133223.0568B3850412@sourceware.org> Date: Mon, 26 Oct 2020 13:32:23 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Oct 2020 13:32:23 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e83aad1851e8fa453c53e1663141f48014ea4a7c commit e83aad1851e8fa453c53e1663141f48014ea4a7c Author: dougm 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.