Cast to IntPtr if .NET < 7

This commit is contained in:
Oliver Booth 2022-11-30 18:39:02 +00:00
parent b95de092f8
commit 61042ee5e8
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
1 changed files with 4 additions and 0 deletions

View File

@ -242,7 +242,11 @@ public abstract class VirtualParadiseObject : IEquatable<VirtualParadiseObject>
{
unsafe
{
#if NET7_0_OR_GREATER
data = new Span<byte>(dataPtr.ToPointer(), length);
#else
data = new Span<byte>(((IntPtr)dataPtr).ToPointer(), length);
#endif
}
}