Don't export private headers from Buck target (#1269)

Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1269

X-link: https://github.com/facebook/react-native/pull/37127

This prevents targets which include Yoga from using its private APIs.

Instances of this have been mostly cleaned up in the past diffs, with the major exception of RN Fabric. To stage this without blocking on that, I added a `yoga-private-api` target for now to keep using these headers while making it unlikely new usages will show up.

Reviewed By: javache

Differential Revision: D45339425

fbshipit-source-id: eb7ef151ad2467d7c3370cd7c10d47e8db9496a0
This commit is contained in:
Nick Gerleman
2023-05-02 18:08:58 -07:00
committed by Facebook GitHub Bot
parent 080d16cabf
commit d8dec0f85a
5 changed files with 28 additions and 44 deletions

View File

@@ -5,6 +5,8 @@
* LICENSE file in the root directory of this source tree.
*/
#include <yoga/Yoga.h>
const short int LAYOUT_EDGE_SET_FLAG_INDEX = 0;
const short int LAYOUT_WIDTH_INDEX = 1;
const short int LAYOUT_HEIGHT_INDEX = 2;
@@ -36,14 +38,14 @@ public:
YGNodeEdges(YGNodeRef node) {
auto context = YGNodeContext{};
context.asVoidPtr = node->getContext();
context.asVoidPtr = YGNodeGetContext(node);
edges_ = context.edgesSet;
}
void setOn(YGNodeRef node) {
auto context = YGNodeContext{};
context.edgesSet = edges_;
node->setContext(context.asVoidPtr);
YGNodeSetContext(node, context.asVoidPtr);
}
bool has(Edge edge) { return (edges_ & edge) == edge; }