From 3304c1ae5ddb3fe613c60722e7f71d6c492da42f Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Fri, 10 Feb 2017 15:21:34 -0800 Subject: [PATCH] fix if and cosmetic changes --- csharp/Facebook.Yoga/Native.cs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/csharp/Facebook.Yoga/Native.cs b/csharp/Facebook.Yoga/Native.cs index e6ecaefe..59dd84c7 100644 --- a/csharp/Facebook.Yoga/Native.cs +++ b/csharp/Facebook.Yoga/Native.cs @@ -22,7 +22,9 @@ namespace Facebook.Yoga internal class YGNodeHandle : SafeHandle { +#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__ private GCHandle _managed; +#endif private YGNodeHandle() : base(IntPtr.Zero, true) { @@ -89,14 +91,6 @@ namespace Facebook.Yoga [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern int YGNodeGetInstanceCount(); -#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__ - [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern IntPtr YGNodeGetContext(IntPtr node); - - [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] - public static extern void YGNodeSetContext(IntPtr node, IntPtr managed); -#endif - [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] public static extern void YGSetExperimentalFeatureEnabled( YogaExperimentalFeature feature, @@ -373,5 +367,17 @@ namespace Facebook.Yoga public static extern YogaDirection YGNodeLayoutGetDirection(YGNodeHandle node); #endregion + + #region IOS + +#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__ + [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr YGNodeGetContext(IntPtr node); + + [DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)] + public static extern void YGNodeSetContext(IntPtr node, IntPtr managed); +#endif + + #endregion } }