This repository has been archived on 2026-01-05. You can view files and clone it, but cannot push or open issues/pull-requests.
ryubing/Ryujinx.Audio/Native/libsoundio/MarshalExtensions.cs

24 lines
544 B
C#

using System;
using System.Runtime.InteropServices;
namespace SoundIOSharp
{
public static class MarshalEx
{
public static double ReadDouble (IntPtr handle, int offset = 0)
{
return BitConverter.Int64BitsToDouble (Marshal.ReadInt64 (handle, offset));
}
public static void WriteDouble (IntPtr handle, double value)
{
WriteDouble (handle, 0, value);
}
public static void WriteDouble (IntPtr handle, int offset, double value)
{
Marshal.WriteInt64 (handle, offset, BitConverter.DoubleToInt64Bits (value));
}
}
}