Pass const ref parameters as in parameters in C# bindings
_amend in parameters
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Flax.Build.Bindings
|
||||
{
|
||||
@@ -1041,7 +1042,12 @@ namespace Flax.Build.Bindings
|
||||
if (isGetter)
|
||||
propertyInfo.Getter = functionInfo;
|
||||
else
|
||||
{
|
||||
propertyInfo.Setter = functionInfo;
|
||||
|
||||
// Setter value parameter should always be const, forces bindings to pass value as "in" instead of "ref"
|
||||
CollectionsMarshal.AsSpan(functionInfo.Parameters)[0].IsConst = true;
|
||||
}
|
||||
propertyInfo.DeprecatedMessage = functionInfo.DeprecatedMessage;
|
||||
propertyInfo.IsHidden |= functionInfo.IsHidden;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user