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: https://github.com/facebook/yoga/pull/848 Reviewed By: SidharthGuglani Differential Revision: D13848609 Pulled By: davidaurelio fbshipit-source-id: eab046ff3c47e49706f515e209d8aaf750c2198f
This commit is contained in:
parent
c435ff382e
commit
dfcbf9729f
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue