From ad86cf81628d0d6ad4e4f38313f7f92bd2a6e47d Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Sat, 5 Jan 2019 19:49:36 -0500 Subject: [PATCH 1/2] Adds fixes for react-native-windows UWP Specifically, updates the UWP .vcxproj for MSBuild and also exposes the UseLegacyStretchBehaviour API for use with react-native-windows. --- csharp/Facebook.Yoga/Native.cs | 8 ++++ csharp/Facebook.Yoga/YogaConfig.cs | 15 +++++- csharp/Yoga/Yoga.Universal.vcxproj | 46 +++++++++++------- csharp/Yoga/Yoga.Universal.vcxproj.filters | 56 ++++++++++++++++++---- yoga/Yoga.h | 6 +-- 5 files changed, 100 insertions(+), 31 deletions(-) diff --git a/csharp/Facebook.Yoga/Native.cs b/csharp/Facebook.Yoga/Native.cs index 02e9399d87..3271c7d272 100644 --- a/csharp/Facebook.Yoga/Native.cs +++ b/csharp/Facebook.Yoga/Native.cs @@ -74,6 +74,14 @@ public static extern void YGConfigSetUseWebDefaults( [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern bool YGConfigGetUseWebDefaults(YGConfigHandle config); + [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] + public static extern void YGConfigSetUseLegacyStretchBehaviour( + YGConfigHandle config, + bool useLegacyStretchBehavior); + + [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] + public static extern bool YGConfigGetUseLegacyStretchBehaviour(YGConfigHandle config); + [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGConfigSetPointScaleFactor( YGConfigHandle config, diff --git a/csharp/Facebook.Yoga/YogaConfig.cs b/csharp/Facebook.Yoga/YogaConfig.cs index 7f175725e3..b8e58e093d 100644 --- a/csharp/Facebook.Yoga/YogaConfig.cs +++ b/csharp/Facebook.Yoga/YogaConfig.cs @@ -1,4 +1,4 @@ -/** +/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -117,6 +117,19 @@ public bool UseWebDefaults } } + public bool UseLegacyStretchBehaviour + { + get + { + return Native.YGConfigGetUseLegacyStretchBehaviour(_ygConfig); + } + + set + { + Native.YGConfigSetUseLegacyStretchBehaviour(_ygConfig, value); + } + } + public float PointScaleFactor { set diff --git a/csharp/Yoga/Yoga.Universal.vcxproj b/csharp/Yoga/Yoga.Universal.vcxproj index 43d62b1797..1c956466ec 100644 --- a/csharp/Yoga/Yoga.Universal.vcxproj +++ b/csharp/Yoga/Yoga.Universal.vcxproj @@ -1,4 +1,4 @@ - + @@ -33,47 +33,47 @@ Yoga true Windows Store - 10.0.10586.0 - 10.0.10240.0 + 10.0.14393.0 + 10.0.14393.0 10.0 DynamicLibrary true - v140 + v141 Unicode DynamicLibrary true - v140 + v141 Unicode DynamicLibrary false - v140 + v141 true Unicode DynamicLibrary false - v140 + v141 true Unicode DynamicLibrary true - v140 + v141 Unicode DynamicLibrary false - v140 + v141 true Unicode @@ -116,7 +116,7 @@ true bin\Universal\$(PlatformTarget)\$(Configuration)\ - obj\$(PlatformTarget)\$(Configuration)\ + obj\Universal\$(PlatformTarget)\$(Configuration)\ yoga @@ -242,19 +242,31 @@ + + - + + - + + + + + - - - - + + + + + + + + + false @@ -284,4 +296,4 @@ - \ No newline at end of file + diff --git a/csharp/Yoga/Yoga.Universal.vcxproj.filters b/csharp/Yoga/Yoga.Universal.vcxproj.filters index 84cee3aac8..697d52c169 100644 --- a/csharp/Yoga/Yoga.Universal.vcxproj.filters +++ b/csharp/Yoga/Yoga.Universal.vcxproj.filters @@ -21,22 +21,40 @@ Header Files - + + Header Files + + + Header Files + + + Header Files + + + Header Files + + Header Files Header Files - + Header Files - + Header Files - + Header Files - + + Header Files + + + Header Files + + Header Files @@ -47,16 +65,34 @@ Source Files - + Source Files - + Source Files - + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + Source Files - + Source Files @@ -65,4 +101,4 @@ Resource Files - \ No newline at end of file + diff --git a/yoga/Yoga.h b/yoga/Yoga.h index dddab8bb34..237fc46b0b 100644 --- a/yoga/Yoga.h +++ b/yoga/Yoga.h @@ -174,11 +174,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( From f29356d60ba880c599b11ac8c7a8355d9a3ac871 Mon Sep 17 00:00:00 2001 From: Eric Rozell Date: Sat, 5 Jan 2019 23:58:13 -0500 Subject: [PATCH 2/2] Remove WIN_STRUCT macro If ARM compatibility still requires the WIN_STRUCT macro, we have a lot of additional changes to make. Removing for now, as this is clearly broken for some Yoga values (e.g., margin, padding, etc.). Will follow up with another PR after validating that we still need to pass structs by ref in RS1 or later. --- csharp/Facebook.Yoga/Native.cs | 26 +++++------- csharp/Facebook.Yoga/YogaNode.Spacing.cs | 50 ++++++++++++------------ csharp/Facebook.Yoga/YogaNode.cs | 16 ++++---- csharp/Facebook.Yoga/YogaValue.cs | 12 ------ csharp/Yoga/Yoga.vcxproj | 12 +++--- yoga/YGMacros.h | 8 ---- yoga/Yoga.cpp | 4 +- yoga/Yoga.h | 2 +- 8 files changed, 52 insertions(+), 78 deletions(-) diff --git a/csharp/Facebook.Yoga/Native.cs b/csharp/Facebook.Yoga/Native.cs index 3271c7d272..7ec1ab186e 100644 --- a/csharp/Facebook.Yoga/Native.cs +++ b/csharp/Facebook.Yoga/Native.cs @@ -10,12 +10,6 @@ namespace Facebook.Yoga { -#if WINDOWS_UWP_ARM - using YogaValueType = IntPtr; -#else - using YogaValueType = YogaValue; -#endif - internal static class Native { #if (UNITY_IOS && !UNITY_EDITOR) || __IOS__ @@ -234,7 +228,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetFlexBasisAuto(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetFlexBasis(YGNodeHandle node); + public static extern YogaValue YGNodeStyleGetFlexBasis(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetWidth(YGNodeHandle node, float width); @@ -246,7 +240,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetWidthAuto(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetWidth(YGNodeHandle node); + public static extern YogaValue YGNodeStyleGetWidth(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetHeight(YGNodeHandle node, float height); @@ -258,7 +252,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetHeightAuto(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetHeight(YGNodeHandle node); + public static extern YogaValue YGNodeStyleGetHeight(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetMinWidth(YGNodeHandle node, float minWidth); @@ -267,7 +261,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetMinWidthPercent(YGNodeHandle node, float minWidth); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetMinWidth(YGNodeHandle node); + public static extern YogaValue YGNodeStyleGetMinWidth(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetMinHeight(YGNodeHandle node, float minHeight); @@ -276,7 +270,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetMinHeightPercent(YGNodeHandle node, float minHeight); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetMinHeight(YGNodeHandle node); + public static extern YogaValue YGNodeStyleGetMinHeight(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetMaxWidth(YGNodeHandle node, float maxWidth); @@ -285,7 +279,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetMaxWidthPercent(YGNodeHandle node, float maxWidth); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetMaxWidth(YGNodeHandle node); + public static extern YogaValue YGNodeStyleGetMaxWidth(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetMaxHeight(YGNodeHandle node, float maxHeight); @@ -294,7 +288,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetMaxHeightPercent(YGNodeHandle node, float maxHeight); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetMaxHeight(YGNodeHandle node); + public static extern YogaValue YGNodeStyleGetMaxHeight(YGNodeHandle node); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetAspectRatio(YGNodeHandle node, float aspectRatio); @@ -313,7 +307,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetPositionPercent(YGNodeHandle node, YogaEdge edge, float position); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetPosition(YGNodeHandle node, YogaEdge edge); + public static extern YogaValue YGNodeStyleGetPosition(YGNodeHandle node, YogaEdge edge); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetMargin(YGNodeHandle node, YogaEdge edge, float margin); @@ -325,7 +319,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetMarginAuto(YGNodeHandle node, YogaEdge edge); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetMargin(YGNodeHandle node, YogaEdge edge); + public static extern YogaValue YGNodeStyleGetMargin(YGNodeHandle node, YogaEdge edge); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetPadding(YGNodeHandle node, YogaEdge edge, float padding); @@ -334,7 +328,7 @@ public static extern void YGNodeSetHasNewLayout( public static extern void YGNodeStyleSetPaddingPercent(YGNodeHandle node, YogaEdge edge, float padding); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern YogaValueType YGNodeStyleGetPadding(YGNodeHandle node, YogaEdge edge); + public static extern YogaValue YGNodeStyleGetPadding(YGNodeHandle node, YogaEdge edge); [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGNodeStyleSetBorder(YGNodeHandle node, YogaEdge edge, float border); diff --git a/csharp/Facebook.Yoga/YogaNode.Spacing.cs b/csharp/Facebook.Yoga/YogaNode.Spacing.cs index df9157c9d3..d3a8f86492 100644 --- a/csharp/Facebook.Yoga/YogaNode.Spacing.cs +++ b/csharp/Facebook.Yoga/YogaNode.Spacing.cs @@ -1,4 +1,4 @@ -/** +/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -13,7 +13,7 @@ public YogaValue Left { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Left)); + return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Left); } set @@ -26,7 +26,7 @@ public YogaValue Top { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Top)); + return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Top); } set @@ -39,7 +39,7 @@ public YogaValue Right { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Right)); + return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Right); } set @@ -52,7 +52,7 @@ public YogaValue Bottom { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Bottom)); + return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Bottom); } set @@ -65,7 +65,7 @@ public YogaValue Start { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Start)); + return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Start); } set @@ -78,7 +78,7 @@ public YogaValue End { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.End)); + return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.End); } set @@ -103,7 +103,7 @@ public YogaValue MarginLeft { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Left)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Left); } set @@ -116,7 +116,7 @@ public YogaValue MarginTop { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Top)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Top); } set @@ -129,7 +129,7 @@ public YogaValue MarginRight { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Right)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Right); } set @@ -142,7 +142,7 @@ public YogaValue MarginBottom { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Bottom)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Bottom); } set @@ -155,7 +155,7 @@ public YogaValue MarginStart { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Start)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Start); } set @@ -168,7 +168,7 @@ public YogaValue MarginEnd { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.End)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.End); } set @@ -181,7 +181,7 @@ public YogaValue MarginHorizontal { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Horizontal)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Horizontal); } set @@ -194,7 +194,7 @@ public YogaValue MarginVertical { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Vertical)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Vertical); } set @@ -207,7 +207,7 @@ public YogaValue Margin { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.All)); + return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.All); } set @@ -236,7 +236,7 @@ public YogaValue PaddingLeft { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Left)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Left); } set @@ -249,7 +249,7 @@ public YogaValue PaddingTop { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Top)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Top); } set @@ -262,7 +262,7 @@ public YogaValue PaddingRight { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Right)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Right); } set @@ -275,7 +275,7 @@ public YogaValue PaddingBottom { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Bottom)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Bottom); } set @@ -288,7 +288,7 @@ public YogaValue PaddingStart { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Start)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Start); } set @@ -301,7 +301,7 @@ public YogaValue PaddingEnd { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.End)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.End); } set @@ -314,7 +314,7 @@ public YogaValue PaddingHorizontal { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Horizontal)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Horizontal); } set @@ -327,7 +327,7 @@ public YogaValue PaddingVertical { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Vertical)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Vertical); } set @@ -340,7 +340,7 @@ public YogaValue Padding { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.All)); + return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.All); } set diff --git a/csharp/Facebook.Yoga/YogaNode.cs b/csharp/Facebook.Yoga/YogaNode.cs index b1f30b2272..f681ec8954 100644 --- a/csharp/Facebook.Yoga/YogaNode.cs +++ b/csharp/Facebook.Yoga/YogaNode.cs @@ -1,4 +1,4 @@ -/** +/** * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the @@ -271,7 +271,7 @@ public YogaValue FlexBasis { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetFlexBasis(_ygNode)); + return Native.YGNodeStyleGetFlexBasis(_ygNode); } set @@ -295,7 +295,7 @@ public YogaValue Width { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetWidth(_ygNode)); + return Native.YGNodeStyleGetWidth(_ygNode); } set @@ -319,7 +319,7 @@ public YogaValue Height { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetHeight(_ygNode)); + return Native.YGNodeStyleGetHeight(_ygNode); } set @@ -343,7 +343,7 @@ public YogaValue MaxWidth { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMaxWidth(_ygNode)); + return Native.YGNodeStyleGetMaxWidth(_ygNode); } set @@ -363,7 +363,7 @@ public YogaValue MaxHeight { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMaxHeight(_ygNode)); + return Native.YGNodeStyleGetMaxHeight(_ygNode); } set @@ -383,7 +383,7 @@ public YogaValue MinWidth { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMinWidth(_ygNode)); + return Native.YGNodeStyleGetMinWidth(_ygNode); } set @@ -403,7 +403,7 @@ public YogaValue MinHeight { get { - return YogaValue.MarshalValue(Native.YGNodeStyleGetMinHeight(_ygNode)); + return Native.YGNodeStyleGetMinHeight(_ygNode); } set diff --git a/csharp/Facebook.Yoga/YogaValue.cs b/csharp/Facebook.Yoga/YogaValue.cs index aca8882ec0..e249828d6f 100644 --- a/csharp/Facebook.Yoga/YogaValue.cs +++ b/csharp/Facebook.Yoga/YogaValue.cs @@ -91,17 +91,5 @@ public static implicit operator YogaValue(float pointValue) { return Point(pointValue); } - -#if WINDOWS_UWP_ARM - internal static YogaValue MarshalValue(IntPtr ptr) - { - return Marshal.PtrToStructure(ptr); - } -#else - internal static YogaValue MarshalValue(YogaValue value) - { - return value; - } -#endif } } diff --git a/csharp/Yoga/Yoga.vcxproj b/csharp/Yoga/Yoga.vcxproj index 489492cbf2..5899a0db99 100755 --- a/csharp/Yoga/Yoga.vcxproj +++ b/csharp/Yoga/Yoga.vcxproj @@ -38,39 +38,39 @@ DynamicLibrary true - v140 + v141 Unicode DynamicLibrary true - v140 + v141 Unicode DynamicLibrary false - v140 + v141 true Unicode DynamicLibrary false - v140 + v141 true Unicode DynamicLibrary true - v140 + v141 Unicode DynamicLibrary false - v140 + v141 true Unicode diff --git a/yoga/YGMacros.h b/yoga/YGMacros.h index 0aafdca36f..eaaf179f3b 100644 --- a/yoga/YGMacros.h +++ b/yoga/YGMacros.h @@ -21,14 +21,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). diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 10f27bf080..abd0dfa1bb 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -734,13 +734,13 @@ struct DimensionProp { } \ } \ \ - WIN_STRUCT(type) \ + 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) \ diff --git a/yoga/Yoga.h b/yoga/Yoga.h index 237fc46b0b..d0d149e9b3 100644 --- a/yoga/Yoga.h +++ b/yoga/Yoga.h @@ -261,7 +261,7 @@ WIN_EXPORT void YGNodeStyleSetPositionPercent( const YGNodeRef node, const YGEdge edge, const float position); -WIN_EXPORT WIN_STRUCT(YGValue) +WIN_EXPORT YGValue YGNodeStyleGetPosition(const YGNodeRef node, const YGEdge edge); WIN_EXPORT void YGNodeStyleSetMargin(