Skip to content

Commit 978d5dc

Browse files
lenaicfacebook-github-bot
authored andcommitted
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
1 parent 16424c2 commit 978d5dc

13 files changed

Lines changed: 14 additions & 13 deletions

‎packages/react-native/ReactCommon/yoga/yoga/node/LayoutResults.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <array>
1111

12+
#include <yoga/YGMacros.h>
1213
#include <yoga/debug/AssertFatal.h>
1314
#include <yoga/enums/Dimension.h>
1415
#include <yoga/enums/Direction.h>
@@ -136,7 +137,7 @@ struct LayoutResults {
136137
padding_[yoga::to_underlying(physicalEdge)] = dimension;
137138
}
138139

139-
bool operator==(LayoutResults layout) const;
140+
YG_EXPORT bool operator==(LayoutResults layout) const;
140141

141142
private:
142143
Direction direction_ : bitCount<Direction>() = Direction::Inherit;

‎scripts/cxx-api/api-snapshots/ReactAndroidDebugCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7242,9 +7242,9 @@ struct facebook::yoga::LayoutData {
72427242
}
72437243

72447244
struct facebook::yoga::LayoutResults {
7245+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
72457246
public bool computedAutoMinMainSizeResolved() const;
72467247
public bool hadOverflow() const;
7247-
public bool operator==(facebook::yoga::LayoutResults layout) const;
72487248
public facebook::yoga::CachedMeasurement cachedLayout;
72497249
public facebook::yoga::Direction direction() const;
72507250
public facebook::yoga::Direction lastOwnerDirection;

‎scripts/cxx-api/api-snapshots/ReactAndroidFrameworksCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11703,9 +11703,9 @@ struct facebook::yoga::LayoutData {
1170311703
}
1170411704

1170511705
struct facebook::yoga::LayoutResults {
11706+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
1170611707
public bool computedAutoMinMainSizeResolved() const;
1170711708
public bool hadOverflow() const;
11708-
public bool operator==(facebook::yoga::LayoutResults layout) const;
1170911709
public facebook::yoga::CachedMeasurement cachedLayout;
1171011710
public facebook::yoga::Direction direction() const;
1171111711
public facebook::yoga::Direction lastOwnerDirection;

‎scripts/cxx-api/api-snapshots/ReactAndroidNewarchCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7091,9 +7091,9 @@ struct facebook::yoga::LayoutData {
70917091
}
70927092

70937093
struct facebook::yoga::LayoutResults {
7094+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
70947095
public bool computedAutoMinMainSizeResolved() const;
70957096
public bool hadOverflow() const;
7096-
public bool operator==(facebook::yoga::LayoutResults layout) const;
70977097
public facebook::yoga::CachedMeasurement cachedLayout;
70987098
public facebook::yoga::Direction direction() const;
70997099
public facebook::yoga::Direction lastOwnerDirection;

‎scripts/cxx-api/api-snapshots/ReactAndroidReleaseCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7091,9 +7091,9 @@ struct facebook::yoga::LayoutData {
70917091
}
70927092

70937093
struct facebook::yoga::LayoutResults {
7094+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
70947095
public bool computedAutoMinMainSizeResolved() const;
70957096
public bool hadOverflow() const;
7096-
public bool operator==(facebook::yoga::LayoutResults layout) const;
70977097
public facebook::yoga::CachedMeasurement cachedLayout;
70987098
public facebook::yoga::Direction direction() const;
70997099
public facebook::yoga::Direction lastOwnerDirection;

‎scripts/cxx-api/api-snapshots/ReactAppleDebugCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8976,9 +8976,9 @@ struct facebook::yoga::LayoutData {
89768976
}
89778977

89788978
struct facebook::yoga::LayoutResults {
8979+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
89798980
public bool computedAutoMinMainSizeResolved() const;
89808981
public bool hadOverflow() const;
8981-
public bool operator==(facebook::yoga::LayoutResults layout) const;
89828982
public facebook::yoga::CachedMeasurement cachedLayout;
89838983
public facebook::yoga::Direction direction() const;
89848984
public facebook::yoga::Direction lastOwnerDirection;

‎scripts/cxx-api/api-snapshots/ReactAppleFrameworksCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13463,9 +13463,9 @@ struct facebook::yoga::LayoutData {
1346313463
}
1346413464

1346513465
struct facebook::yoga::LayoutResults {
13466+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
1346613467
public bool computedAutoMinMainSizeResolved() const;
1346713468
public bool hadOverflow() const;
13468-
public bool operator==(facebook::yoga::LayoutResults layout) const;
1346913469
public facebook::yoga::CachedMeasurement cachedLayout;
1347013470
public facebook::yoga::Direction direction() const;
1347113471
public facebook::yoga::Direction lastOwnerDirection;

‎scripts/cxx-api/api-snapshots/ReactAppleNewarchCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8828,9 +8828,9 @@ struct facebook::yoga::LayoutData {
88288828
}
88298829

88308830
struct facebook::yoga::LayoutResults {
8831+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
88318832
public bool computedAutoMinMainSizeResolved() const;
88328833
public bool hadOverflow() const;
8833-
public bool operator==(facebook::yoga::LayoutResults layout) const;
88348834
public facebook::yoga::CachedMeasurement cachedLayout;
88358835
public facebook::yoga::Direction direction() const;
88368836
public facebook::yoga::Direction lastOwnerDirection;

‎scripts/cxx-api/api-snapshots/ReactAppleReleaseCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8835,9 +8835,9 @@ struct facebook::yoga::LayoutData {
88358835
}
88368836

88378837
struct facebook::yoga::LayoutResults {
8838+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
88388839
public bool computedAutoMinMainSizeResolved() const;
88398840
public bool hadOverflow() const;
8840-
public bool operator==(facebook::yoga::LayoutResults layout) const;
88418841
public facebook::yoga::CachedMeasurement cachedLayout;
88428842
public facebook::yoga::Direction direction() const;
88438843
public facebook::yoga::Direction lastOwnerDirection;

‎scripts/cxx-api/api-snapshots/ReactCommonDebugCxx.api‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4457,9 +4457,9 @@ struct facebook::yoga::LayoutData {
44574457
}
44584458

44594459
struct facebook::yoga::LayoutResults {
4460+
public YG_EXPORT bool operator==(facebook::yoga::LayoutResults layout) const;
44604461
public bool computedAutoMinMainSizeResolved() const;
44614462
public bool hadOverflow() const;
4462-
public bool operator==(facebook::yoga::LayoutResults layout) const;
44634463
public facebook::yoga::CachedMeasurement cachedLayout;
44644464
public facebook::yoga::Direction direction() const;
44654465
public facebook::yoga::Direction lastOwnerDirection;

0 commit comments

Comments
 (0)