From c24fc75dce6952ace09753bb00601af0b7abc080 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Fri, 26 Feb 2021 23:26:05 -0800 Subject: [PATCH] ReactCommon/renderer/components/view: Migrate uses of NDEBUG to REACT_NATIVE_DEBUG + react_native_assert Summary: For better cross-platform consistency, migrate usages of NDEBUG to REACT_NATIVE_DEBUG. See flags.h for explanation. Changelog: [Internal] Reviewed By: PeteTheHeat Differential Revision: D26695203 fbshipit-source-id: df09af5a62044c711368954b5e9b3a114491e2ed --- .../renderer/components/view/YogaLayoutableShadowNode.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp b/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp index d30974b4949..5f17f378a05 100644 --- a/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/react/renderer/components/view/YogaLayoutableShadowNode.cpp @@ -6,6 +6,7 @@ */ #include "YogaLayoutableShadowNode.h" +#include #include #include #include @@ -715,7 +716,7 @@ void YogaLayoutableShadowNode::ensureConsistency() const { } void YogaLayoutableShadowNode::ensureYogaChildrenOwnersConsistency() const { -#ifndef NDEBUG +#ifdef REACT_NATIVE_DEBUG // Checking that all Yoga node children have the same `owner`. // The owner might be not equal to the `yogaNode_` though. auto &yogaChildren = yogaNode_.getChildren(); @@ -730,7 +731,7 @@ void YogaLayoutableShadowNode::ensureYogaChildrenOwnersConsistency() const { } void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const { -#ifndef NDEBUG +#ifdef REACT_NATIVE_DEBUG // Checking that the shapes of Yoga node children object look fine. // This is the only heuristic that might produce false-positive results // (really broken dangled nodes might look fine). This is useful as an early @@ -748,7 +749,7 @@ void YogaLayoutableShadowNode::ensureYogaChildrenLookFine() const { } void YogaLayoutableShadowNode::ensureYogaChildrenAlighment() const { -#ifndef NDEBUG +#ifdef REACT_NATIVE_DEBUG // If the node is not a leaf node, checking that: // - All children are `YogaLayoutableShadowNode` subclasses. // - All Yoga children are owned/connected to corresponding children of