rocket: fix P/Invoke sig for bool
Summary: Fixes the `bool` marshaling issue as describe on [MSDN](https://blogs.msdn.microsoft.com/jaredpar/2008/10/14/pinvoke-and-bool-or-should-i-say-bool/) so C# will now act properly. Closes https://github.com/facebook/css-layout/pull/226 Reviewed By: IanChilds Differential Revision: D3967349 Pulled By: emilsjolander fbshipit-source-id: f61d3bb39eb1b0b6e749629825234615b425e930
This commit is contained in:
committed by
Facebook Github Bot
parent
11f85ce91e
commit
23f2878808
@@ -54,6 +54,9 @@ namespace Facebook.CSSLayout
|
||||
_isDisposed = true;
|
||||
Native.CSSNodeFree(_cssNode);
|
||||
GCHandle.FromIntPtr(_context).Free();
|
||||
_children = null;
|
||||
_parent = null;
|
||||
_measureFunction = null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,11 +71,7 @@ namespace Facebook.CSSLayout
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Native.CSSNodeFree(_cssNode);
|
||||
GCHandle.FromIntPtr(_context).Free();
|
||||
_children = null;
|
||||
_parent = null;
|
||||
_measureFunction = null;
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
public bool IsDirty
|
||||
|
@@ -47,12 +47,14 @@ namespace Facebook.CSSLayout
|
||||
public static extern void CSSNodeMarkDirty(IntPtr node);
|
||||
|
||||
[DllImport(DllName)]
|
||||
[return: MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CSSNodeIsDirty(IntPtr node);
|
||||
|
||||
[DllImport(DllName)]
|
||||
public static extern void CSSNodePrint(IntPtr node, CSSPrintOptions options);
|
||||
|
||||
[DllImport(DllName)]
|
||||
[return: MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CSSValueIsUndefined(float value);
|
||||
|
||||
#region CSS_NODE_PROPERTY
|
||||
@@ -76,15 +78,17 @@ namespace Facebook.CSSLayout
|
||||
public static extern CSSPrintFunc CSSNodeGePrintFunc(IntPtr node);
|
||||
|
||||
[DllImport(DllName)]
|
||||
public static extern void CSSNodeSetIsTextnode(IntPtr node, bool isTextNode);
|
||||
public static extern void CSSNodeSetIsTextnode(IntPtr node, [MarshalAs(UnmanagedType.I1)] bool isTextNode);
|
||||
|
||||
[DllImport(DllName)]
|
||||
[return: MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CSSNodeGetIsTextnode(IntPtr node);
|
||||
|
||||
[DllImport(DllName)]
|
||||
public static extern void CSSNodeSetHasNewLayout(IntPtr node, bool hasNewLayout);
|
||||
public static extern void CSSNodeSetHasNewLayout(IntPtr node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
|
||||
|
||||
[DllImport(DllName)]
|
||||
[return: MarshalAs(UnmanagedType.I1)]
|
||||
public static extern bool CSSNodeGetHasNewLayout(IntPtr node);
|
||||
|
||||
#endregion
|
||||
|
Reference in New Issue
Block a user