Kyle-Gagner / PortAudio.Net

Cross platform .NET wrappers for PortAudio
Mozilla Public License 2.0
12 stars 7 forks source link

make PaBuffer.Span available on other platforms #4

Open medovina opened 4 years ago

medovina commented 4 years ago

I'm compiling PortAudio.Net using Mono since I'd like to use it in a project on Linux.

Unfortunately PaBuffer.Span is not available there, since this #if in PaBuffer.cs excludes it:

 #if NETCOREAPP
        /// ...
        /// <remarks>
        /// Due to its safety and efficiency, <see cref="Span<T>"/> is the preferred means of accessing the memory.
        /// However, this property is not available in .NET Framework, only .NET Core.
        /// </remarks>
        public Span<T> Span
        ...
 #endif

In my opinion it would be better to omit the #if altogether, since Span\<T> works on Mono, and there is a NuGet package that provides Span\<T> for .NET Framework (https://stackoverflow.com/a/60559862/4034070), so this functionailty is now effectively available there as well.