From 978d5dca9f5270dcfecb33792ca7f51a7b6a6abb Mon Sep 17 00:00:00 2001 From: Nick Lefever Date: Fri, 13 Nov 2026 06:36:56 -0800 Subject: [PATCH] Export `LayoutResults::operator==` (#59997) Summary: `yoga::Node` is exported from the Yoga library and hands out its `LayoutResults` through `getLayout()`, but `LayoutResults::operator==` is defined out of line and not exported. Code outside Yoga that compares two layout results fails to link wherever Yoga is built as a shared library with hidden visibility. Mark the operator `YG_EXPORT` so React Native can compare a node's layout results with those of the node it replaces. Changelog: [Internal] Reviewed By: javache Differential Revision: D131770771 --- .../react-native/ReactCommon/yoga/yoga/node/LayoutResults.h | 3 ++- scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api | 2 +- scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api | 2 +- 13 files changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/react-native/ReactCommon/yoga/yoga/node/LayoutResults.h b/packages/react-native/ReactCommon/yoga/yoga/node/LayoutResults.h index 54960a443651..d427aea0385e 100644 --- a/packages/react-native/ReactCommon/yoga/yoga/node/LayoutResults.h +++ b/packages/react-native/ReactCommon/yoga/yoga/node/LayoutResults.h @@ -9,6 +9,7 @@ #include +#include #include #include #include @@ -136,7 +137,7 @@ struct LayoutResults { padding_[yoga::to_underlying(physicalEdge)] = dimension; } - bool operator==(LayoutResults layout) const; + YG_EXPORT bool operator==(LayoutResults layout) const; private: Direction direction_ : bitCount() = Direction::Inherit; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api index 912089515add..921b4861dad4 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api @@ -7242,9 +7242,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api index 2567b4e72da9..29bb4ff776fa 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api @@ -11703,9 +11703,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api index 34b1da7689bb..4687eb5b751d 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api @@ -7091,9 +7091,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api index 34b1da7689bb..4687eb5b751d 100644 --- a/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api @@ -7091,9 +7091,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api index 65b1426db47e..8360a9404bf0 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api @@ -8976,9 +8976,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api index ec76e48de457..10b1d184aae8 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api @@ -13463,9 +13463,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api index c8c92eb83ed1..5b242c3dae4c 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api @@ -8828,9 +8828,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api index 3ebc82e69ba0..28d77a4d0711 100644 --- a/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api @@ -8835,9 +8835,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api index 2ef9e05072ac..1f658ff7f2d1 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api @@ -4457,9 +4457,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api index 58f5c38aa6a0..693da7d2e85d 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonFrameworksCxx.api @@ -8809,9 +8809,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api index 9279765a5038..c3f7f25e8261 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonNewarchCxx.api @@ -4450,9 +4450,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection; diff --git a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api index 9279765a5038..c3f7f25e8261 100644 --- a/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api +++ b/scripts/cxx-api/api-snapshots/ReactCommonReleaseCxx.api @@ -4450,9 +4450,9 @@ struct facebook::yoga::LayoutData { } struct facebook::yoga::LayoutResults { + public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const; public bool computedAutoMinMainSizeResolved() const; public bool hadOverflow() const; - public bool operator==(facebook::yoga::LayoutResults layout) const; public facebook::yoga::CachedMeasurement cachedLayout; public facebook::yoga::Direction direction() const; public facebook::yoga::Direction lastOwnerDirection;