Skip to content
Permalink
Browse files

Adds fixes for react-native-windows UWP (#848)

Summary:
Specifically, updates the UWP .vcxproj for MSBuild and also exposes the UseLegacyStretchBehaviour API for use with react-native-windows.
Pull Request resolved: facebook/yoga#848

Reviewed By: SidharthGuglani

Differential Revision: D13848609

Pulled By: davidaurelio

fbshipit-source-id: eab046ff3c47e49706f515e209d8aaf750c2198f
  • Loading branch information...
rozele authored and facebook-github-bot committed Jan 31, 2019
1 parent c435ff3 commit dfcbf9729fab64c4bd8c00e1d092ec4e9bae717f
Showing with 9 additions and 18 deletions.
  1. +0 −8 ReactCommon/yoga/yoga/YGMacros.h
  2. +4 −5 ReactCommon/yoga/yoga/Yoga.cpp
  3. +5 −5 ReactCommon/yoga/yoga/Yoga.h
@@ -20,14 +20,6 @@
#define WIN_EXPORT
#endif

#ifdef WINARMDLL
#define WIN_STRUCT(type) type*
#define WIN_STRUCT_REF(value) &value
#else
#define WIN_STRUCT(type) type
#define WIN_STRUCT_REF(value) value
#endif

#ifdef NS_ENUM
// Cannot use NSInteger as NSInteger has a different size than int (which is the
// default type of a enum). Therefor when linking the Yoga C library into obj-c
@@ -602,12 +602,12 @@ inline detail::CompactValue Value::create<YGUnitAuto>(float) {
template <YGStyle::Dimensions YGStyle::*P>
struct DimensionProp {
template <YGDimension idx>
static WIN_STRUCT(YGValue) get(YGNodeRef node) {
static YGValue get(YGNodeRef node) {
YGValue value = (node->getStyle().*P)[idx];
if (value.unit == YGUnitUndefined || value.unit == YGUnitAuto) {
value.value = YGUndefined;
}
return WIN_STRUCT_REF(value);
return value;
}

template <YGDimension idx, YGUnit U>
@@ -690,13 +690,12 @@ struct DimensionProp {
} \
} \
\
WIN_STRUCT(type) \
YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge) { \
type YGNodeStyleGet##name(const YGNodeRef node, const YGEdge edge) { \
YGValue value = node->getStyle().instanceName[edge]; \
if (value.unit == YGUnitUndefined || value.unit == YGUnitAuto) { \
value.value = YGUndefined; \
} \
return WIN_STRUCT_REF(value); \
return value; \
}

#define YG_NODE_LAYOUT_PROPERTY_IMPL(type, name, instanceName) \
@@ -140,11 +140,11 @@ YGDirtiedFunc YGNodeGetDirtiedFunc(YGNodeRef node);
void YGNodeSetDirtiedFunc(YGNodeRef node, YGDirtiedFunc dirtiedFunc);
YGPrintFunc YGNodeGetPrintFunc(YGNodeRef node);
void YGNodeSetPrintFunc(YGNodeRef node, YGPrintFunc printFunc);
bool YGNodeGetHasNewLayout(YGNodeRef node);
void YGNodeSetHasNewLayout(YGNodeRef node, bool hasNewLayout);
WIN_EXPORT bool YGNodeGetHasNewLayout(YGNodeRef node);
WIN_EXPORT void YGNodeSetHasNewLayout(YGNodeRef node, bool hasNewLayout);
YGNodeType YGNodeGetNodeType(YGNodeRef node);
void YGNodeSetNodeType(YGNodeRef node, YGNodeType nodeType);
bool YGNodeIsDirty(YGNodeRef node);
WIN_EXPORT bool YGNodeIsDirty(YGNodeRef node);
bool YGNodeLayoutGetDidUseLegacyFlag(const YGNodeRef node);

WIN_EXPORT void YGNodeStyleSetDirection(
@@ -227,8 +227,8 @@ WIN_EXPORT void YGNodeStyleSetPositionPercent(
const YGNodeRef node,
const YGEdge edge,
const float position);
WIN_EXPORT WIN_STRUCT(YGValue)
YGNodeStyleGetPosition(const YGNodeRef node, const YGEdge edge);
WIN_EXPORT YGValue
YGNodeStyleGetPosition(const YGNodeRef node, const YGEdge edge);

WIN_EXPORT void YGNodeStyleSetMargin(
const YGNodeRef node,

0 comments on commit dfcbf97

Please sign in to comment.
You can’t perform that action at this time.