mirror of
https://github.com/amerkoleci/Vortice.Win32.git
synced 2026-01-14 08:06:02 +08:00
Add C# 11 support WIP and net7.0 support.
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<LangVersion>10.0</LangVersion>
|
||||
<LangVersion>11.0</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
|
||||
<EnablePreviewFeatures>true</EnablePreviewFeatures>
|
||||
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
<NoWarn>CS1591;CS1701</NoWarn>
|
||||
@@ -37,6 +39,11 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
|
||||
<PackageReference Include="Microsoft.Net.Compilers.Toolset" Version="4.4.0-2.final">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
15
NuGet.config
15
NuGet.config
@@ -1,13 +1,16 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
</packageSources>
|
||||
|
||||
<packageSourceMapping>
|
||||
<packageSource key="nuget.org">
|
||||
<packageSource key="nuget">
|
||||
<package pattern="*" />
|
||||
</packageSource>
|
||||
<packageSource key="dotnet-tools">
|
||||
<package pattern="Microsoft.Net.Compilers.Toolset" />
|
||||
</packageSource>
|
||||
</packageSourceMapping>
|
||||
<packageSources>
|
||||
<clear />
|
||||
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
|
||||
</packageSources>
|
||||
</configuration>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<OutputType>Exe</OutputType>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<IsPackable>false</IsPackable>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
using System.Globalization;
|
||||
|
||||
namespace Win32.Com;
|
||||
|
||||
/// <summary>
|
||||
|
||||
11
src/Vortice.Win32/INativeGuid.cs
Normal file
11
src/Vortice.Win32/INativeGuid.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
// Copyright © Amer Koleci and Contributors.
|
||||
// Licensed under the MIT License (MIT). See LICENSE in the repository root for more information.
|
||||
|
||||
namespace Win32;
|
||||
|
||||
public unsafe interface INativeGuid
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
protected internal static Guid* NativeGuid { get; }
|
||||
#endif
|
||||
}
|
||||
@@ -7,7 +7,7 @@ using System.Runtime.CompilerServices;
|
||||
namespace Win32;
|
||||
|
||||
[Guid("00000000-0000-0000-C000-000000000046")]
|
||||
public unsafe partial struct IUnknown
|
||||
public unsafe partial struct IUnknown : INativeGuid
|
||||
{
|
||||
public static ref readonly Guid IID_IUnknown
|
||||
{
|
||||
@@ -32,7 +32,11 @@ public unsafe partial struct IUnknown
|
||||
}
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
internal static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IUnknown));
|
||||
#else
|
||||
public static Guid* NativeGuid => (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in IID_IUnknown));
|
||||
#endif
|
||||
|
||||
public void** lpVtbl;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>netstandard2.0;net6.0;</TargetFrameworks>
|
||||
<TargetFrameworks>netstandard2.0;net6.0;net7.0</TargetFrameworks>
|
||||
<Description>Windows API low level bindings.</Description>
|
||||
<VersionPrefix>1.6.0</VersionPrefix>
|
||||
<VersionSuffix Condition="'$(VersionSuffix)' == ''"></VersionSuffix>
|
||||
|
||||
Reference in New Issue
Block a user