mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
Change NET6_0_OR_GREATER to NET8_0_OR_GREATER
Co-authored-by: adamhathcock <527620+adamhathcock@users.noreply.github.com>
This commit is contained in:
@@ -82,7 +82,7 @@ namespace SharpCompress.Common
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET8_0_OR_GREATER
|
||||
public async ValueTask DisposeAsync()
|
||||
{
|
||||
if (_disposed)
|
||||
|
||||
@@ -16,7 +16,7 @@ public static unsafe class UnsafeHelper
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void* malloc(ulong size)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET8_0_OR_GREATER
|
||||
var ptr = NativeMemory.Alloc((nuint)size);
|
||||
#else
|
||||
var ptr = (void*)Marshal.AllocHGlobal((nint)size);
|
||||
@@ -31,7 +31,7 @@ public static unsafe class UnsafeHelper
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void* calloc(ulong num, ulong size)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET8_0_OR_GREATER
|
||||
return NativeMemory.AllocZeroed((nuint)num, (nuint)size);
|
||||
#else
|
||||
var total = num * size;
|
||||
@@ -53,7 +53,7 @@ public static unsafe class UnsafeHelper
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void free(void* ptr)
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET8_0_OR_GREATER
|
||||
NativeMemory.Free(ptr);
|
||||
#else
|
||||
Marshal.FreeHGlobal((IntPtr)ptr);
|
||||
|
||||
@@ -189,7 +189,7 @@ internal static class Utility
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
#if NET8_0_OR_GREATER
|
||||
public bool ReadFully(byte[] buffer)
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user