Skip to content

Commit 0ce3d28

Browse files
committed
Fix declared api and proj file
-also uncomment HResult Manual whoops
1 parent 762204c commit 0ce3d28

File tree

3 files changed

+148
-155
lines changed

3 files changed

+148
-155
lines changed

sources/Core/Core/HRESULT.Manual.cs

Lines changed: 139 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -10,142 +10,142 @@ namespace Silk.NET.Core;
1010
/// <summary>
1111
/// Common error code value returned by Microsoft methods
1212
/// </summary>
13-
//public partial struct HResult
14-
//{
15-
// /// <summary>
16-
// /// Has the function failed
17-
// /// </summary>
18-
// public bool Failed => Value < 0;
19-
20-
// /// <summary>
21-
// /// Has the function succeeded
22-
// /// </summary>
23-
// public bool Succeeded => Value >= 0;
24-
25-
// /// <summary>
26-
// /// Does the given HResult value indicates success
27-
// /// </summary>
28-
// /// <param name="hr">HResult value</param>
29-
// /// <returns>Whether the value indicates success</returns>
30-
// [MethodImpl((MethodImplOptions)768)]
31-
// public static bool IndicatesSuccess(int hr) => hr >= 0;
32-
33-
// /// <summary>
34-
// /// Does the given HResult value indicates failure
35-
// /// </summary>
36-
// /// <param name="hr">HResult value</param>
37-
// /// <returns>Whether the value indicates failure</returns>
38-
// [MethodImpl((MethodImplOptions)768)]
39-
// public static bool IndicatesFailure(int hr) => hr < 0;
40-
41-
// /// <summary>
42-
// /// Does the given HResult status indicates error
43-
// /// </summary>
44-
// /// <param name="status">HResult status value</param>
45-
// /// <returns>Whether the value indicates error</returns>
46-
// [MethodImpl((MethodImplOptions)768)]
47-
// public static bool IndicatesError(int status) => ((uint)status >> 31) == 1;
48-
49-
// /// <summary>
50-
// /// Gets the code from the given HResult value
51-
// /// </summary>
52-
// /// <param name="hr">HResult value</param>
53-
// /// <returns>code of the HResult</returns>
54-
// [MethodImpl((MethodImplOptions)768)]
55-
// public static int GetCode(int hr) => hr & 0xFFFF;
56-
57-
// /// <summary>
58-
// /// Gets the facility from the given HResult value
59-
// /// </summary>
60-
// /// <param name="hr">HResult value</param>
61-
// /// <returns>facility of the HResult</returns>
62-
// [MethodImpl((MethodImplOptions)768)]
63-
// public static int GetFacility(int hr) => (hr >> 16) & 0x1FFF;
64-
65-
// /// <summary>
66-
// /// Gets the severity from the given HResult value
67-
// /// </summary>
68-
// /// <param name="hr">HResult value</param>
69-
// /// <returns>severity of the HResult</returns>
70-
// [MethodImpl((MethodImplOptions)768)]
71-
// public static int GetSeverity(int hr) => (hr >> 31) & 1;
72-
73-
// /// <summary>
74-
// /// Creates a HResult from the given severity, facility, and code values
75-
// /// </summary>
76-
// /// <param name="severity">severity value</param>
77-
// /// <param name="facility">facility value</param>
78-
// /// <param name="code">code value</param>
79-
// /// <returns>HResult with the given severity, facility, and code</returns>
80-
// [MethodImpl((MethodImplOptions)768)]
81-
// public static int Create(int severity, int facility, int code) =>
82-
// (int)(((uint)severity << 31) | ((uint)facility << 16) | (uint)code);
83-
84-
// /// <summary>
85-
// /// Constructs a HResult from the given severity, facility, and code values
86-
// /// </summary>
87-
// /// <param name="severity">severity value</param>
88-
// /// <param name="facility">facility value</param>
89-
// /// <param name="code">code value</param>
90-
// public HResult(int severity, int facility, int code) =>
91-
// Value = Create(severity, facility, code);
92-
93-
// /// <summary>
94-
// /// Does this HResult represent a success
95-
// /// </summary>
96-
// public bool IsSuccess
97-
// {
98-
// [MethodImpl((MethodImplOptions)768)]
99-
// get => IndicatesSuccess(Value);
100-
// }
101-
102-
// /// <summary>
103-
// /// Does this HResult represent a failure
104-
// /// </summary>
105-
// public bool IsFailure
106-
// {
107-
// [MethodImpl((MethodImplOptions)768)]
108-
// get => IndicatesFailure(Value);
109-
// }
110-
111-
// /// <summary>
112-
// /// Does this HResult represent a error
113-
// /// </summary>
114-
// public bool IsError
115-
// {
116-
// [MethodImpl((MethodImplOptions)768)]
117-
// get => IndicatesError(Value);
118-
// }
119-
120-
// /// <summary>
121-
// /// Gets the code for this HResult
122-
// /// </summary>
123-
// public int Code
124-
// {
125-
// [MethodImpl((MethodImplOptions)768)]
126-
// get => GetCode(Value);
127-
// }
128-
129-
// /// <summary>
130-
// /// Gets the facility for this HResult
131-
// /// </summary>
132-
// public int Facility
133-
// {
134-
// [MethodImpl((MethodImplOptions)768)]
135-
// get => GetFacility(Value);
136-
// }
137-
138-
// /// <summary>
139-
// /// Gets the severity for this HResult
140-
// /// </summary>
141-
// public int Severity
142-
// {
143-
// [MethodImpl((MethodImplOptions)768)]
144-
// get => GetSeverity(Value);
145-
// }
146-
147-
// /// <summary>
148-
// /// Throws this HResult as an exception
149-
// /// </summary>
150-
// public void Throw() => Marshal.ThrowExceptionForHR(Value);
151-
//}
13+
public partial struct HResult
14+
{
15+
/// <summary>
16+
/// Has the function failed
17+
/// </summary>
18+
public bool Failed => Value < 0;
19+
20+
/// <summary>
21+
/// Has the function succeeded
22+
/// </summary>
23+
public bool Succeeded => Value >= 0;
24+
25+
/// <summary>
26+
/// Does the given HResult value indicates success
27+
/// </summary>
28+
/// <param name="hr">HResult value</param>
29+
/// <returns>Whether the value indicates success</returns>
30+
[MethodImpl((MethodImplOptions)768)]
31+
public static bool IndicatesSuccess(int hr) => hr >= 0;
32+
33+
/// <summary>
34+
/// Does the given HResult value indicates failure
35+
/// </summary>
36+
/// <param name="hr">HResult value</param>
37+
/// <returns>Whether the value indicates failure</returns>
38+
[MethodImpl((MethodImplOptions)768)]
39+
public static bool IndicatesFailure(int hr) => hr < 0;
40+
41+
/// <summary>
42+
/// Does the given HResult status indicates error
43+
/// </summary>
44+
/// <param name="status">HResult status value</param>
45+
/// <returns>Whether the value indicates error</returns>
46+
[MethodImpl((MethodImplOptions)768)]
47+
public static bool IndicatesError(int status) => ((uint)status >> 31) == 1;
48+
49+
/// <summary>
50+
/// Gets the code from the given HResult value
51+
/// </summary>
52+
/// <param name="hr">HResult value</param>
53+
/// <returns>code of the HResult</returns>
54+
[MethodImpl((MethodImplOptions)768)]
55+
public static int GetCode(int hr) => hr & 0xFFFF;
56+
57+
/// <summary>
58+
/// Gets the facility from the given HResult value
59+
/// </summary>
60+
/// <param name="hr">HResult value</param>
61+
/// <returns>facility of the HResult</returns>
62+
[MethodImpl((MethodImplOptions)768)]
63+
public static int GetFacility(int hr) => (hr >> 16) & 0x1FFF;
64+
65+
/// <summary>
66+
/// Gets the severity from the given HResult value
67+
/// </summary>
68+
/// <param name="hr">HResult value</param>
69+
/// <returns>severity of the HResult</returns>
70+
[MethodImpl((MethodImplOptions)768)]
71+
public static int GetSeverity(int hr) => (hr >> 31) & 1;
72+
73+
/// <summary>
74+
/// Creates a HResult from the given severity, facility, and code values
75+
/// </summary>
76+
/// <param name="severity">severity value</param>
77+
/// <param name="facility">facility value</param>
78+
/// <param name="code">code value</param>
79+
/// <returns>HResult with the given severity, facility, and code</returns>
80+
[MethodImpl((MethodImplOptions)768)]
81+
public static int Create(int severity, int facility, int code) =>
82+
(int)(((uint)severity << 31) | ((uint)facility << 16) | (uint)code);
83+
84+
/// <summary>
85+
/// Constructs a HResult from the given severity, facility, and code values
86+
/// </summary>
87+
/// <param name="severity">severity value</param>
88+
/// <param name="facility">facility value</param>
89+
/// <param name="code">code value</param>
90+
public HResult(int severity, int facility, int code) =>
91+
Value = Create(severity, facility, code);
92+
93+
/// <summary>
94+
/// Does this HResult represent a success
95+
/// </summary>
96+
public bool IsSuccess
97+
{
98+
[MethodImpl((MethodImplOptions)768)]
99+
get => IndicatesSuccess(Value);
100+
}
101+
102+
/// <summary>
103+
/// Does this HResult represent a failure
104+
/// </summary>
105+
public bool IsFailure
106+
{
107+
[MethodImpl((MethodImplOptions)768)]
108+
get => IndicatesFailure(Value);
109+
}
110+
111+
/// <summary>
112+
/// Does this HResult represent a error
113+
/// </summary>
114+
public bool IsError
115+
{
116+
[MethodImpl((MethodImplOptions)768)]
117+
get => IndicatesError(Value);
118+
}
119+
120+
/// <summary>
121+
/// Gets the code for this HResult
122+
/// </summary>
123+
public int Code
124+
{
125+
[MethodImpl((MethodImplOptions)768)]
126+
get => GetCode(Value);
127+
}
128+
129+
/// <summary>
130+
/// Gets the facility for this HResult
131+
/// </summary>
132+
public int Facility
133+
{
134+
[MethodImpl((MethodImplOptions)768)]
135+
get => GetFacility(Value);
136+
}
137+
138+
/// <summary>
139+
/// Gets the severity for this HResult
140+
/// </summary>
141+
public int Severity
142+
{
143+
[MethodImpl((MethodImplOptions)768)]
144+
get => GetSeverity(Value);
145+
}
146+
147+
/// <summary>
148+
/// Throws this HResult as an exception
149+
/// </summary>
150+
public void Throw() => Marshal.ThrowExceptionForHR(Value);
151+
}

sources/Core/Core/PublicAPI/net8.0/PublicAPI.Unshipped.txt

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,10 @@ Silk.NET.Core.IClassFactory.QueryInterface(Silk.NET.Core.Ref<System.Guid> riid,
231231
Silk.NET.Core.IClassFactory.QueryInterface(System.Guid* riid, void** ppvObject) -> Silk.NET.Core.HResult
232232
Silk.NET.Core.IClassFactory.QueryInterface<TCom>(out TCom ppvObject) -> Silk.NET.Core.HResult
233233
Silk.NET.Core.IClassFactory.Release() -> uint
234-
Silk.NET.Core.IComInterface
235-
Silk.NET.Core.IComInterface.GetAddressOf() -> Silk.NET.Core.Ptr2D
236-
Silk.NET.Core.IComInterface.GetAddressOf<TNativeInterface>() -> Silk.NET.Core.Ptr2D<TNativeInterface>
234+
Silk.NET.Core.IComVtbl
235+
Silk.NET.Core.IComVtbl.GetAddressOf() -> Silk.NET.Core.Ptr2D
236+
Silk.NET.Core.IComVtbl.GetAddressOf<TNativeInterface>() -> Silk.NET.Core.Ptr2D<TNativeInterface>
237+
Silk.NET.Core.IComVtbl<T>
237238
Silk.NET.Core.IGLContext
238239
Silk.NET.Core.IGLContext.IsCurrent.get -> bool
239240
Silk.NET.Core.IGLContext.IsCurrent.set -> void
@@ -606,12 +607,10 @@ static Silk.NET.Core.HResult.explicit operator ushort(Silk.NET.Core.HResult valu
606607
static Silk.NET.Core.HResult.GetCode(int hr) -> int
607608
static Silk.NET.Core.HResult.GetFacility(int hr) -> int
608609
static Silk.NET.Core.HResult.GetSeverity(int hr) -> int
609-
static Silk.NET.Core.HResult.implicit operator int(Silk.NET.Core.HResult hr) -> int
610610
static Silk.NET.Core.HResult.implicit operator int(Silk.NET.Core.HResult value) -> int
611611
static Silk.NET.Core.HResult.implicit operator long(Silk.NET.Core.HResult value) -> long
612612
static Silk.NET.Core.HResult.implicit operator nint(Silk.NET.Core.HResult value) -> nint
613613
static Silk.NET.Core.HResult.implicit operator Silk.NET.Core.HResult(byte value) -> Silk.NET.Core.HResult
614-
static Silk.NET.Core.HResult.implicit operator Silk.NET.Core.HResult(int hr) -> Silk.NET.Core.HResult
615614
static Silk.NET.Core.HResult.implicit operator Silk.NET.Core.HResult(int value) -> Silk.NET.Core.HResult
616615
static Silk.NET.Core.HResult.implicit operator Silk.NET.Core.HResult(sbyte value) -> Silk.NET.Core.HResult
617616
static Silk.NET.Core.HResult.implicit operator Silk.NET.Core.HResult(short value) -> Silk.NET.Core.HResult
@@ -695,10 +694,10 @@ static Silk.NET.Core.MaybeBool<T>.implicit operator bool(Silk.NET.Core.MaybeBool
695694
static Silk.NET.Core.MaybeBool<T>.implicit operator Silk.NET.Core.MaybeBool<T>(bool value) -> Silk.NET.Core.MaybeBool<T>
696695
static Silk.NET.Core.MaybeBool<T>.implicit operator Silk.NET.Core.MaybeBool<T>(T Value) -> Silk.NET.Core.MaybeBool<T>
697696
static Silk.NET.Core.MaybeBool<T>.implicit operator T(Silk.NET.Core.MaybeBool<T> value) -> T
698-
static Silk.NET.Core.MaybeBool<T>.operator !=(int lh, Silk.NET.Core.MaybeBool<T> rh) -> bool
699-
static Silk.NET.Core.MaybeBool<T>.operator !=(Silk.NET.Core.MaybeBool<T> lh, int rh) -> bool
700-
static Silk.NET.Core.MaybeBool<T>.operator ==(int lh, Silk.NET.Core.MaybeBool<T> rh) -> bool
701-
static Silk.NET.Core.MaybeBool<T>.operator ==(Silk.NET.Core.MaybeBool<T> lh, int rh) -> bool
697+
static Silk.NET.Core.MaybeBool<T>.operator !=(Silk.NET.Core.MaybeBool<T> lh, T rh) -> bool
698+
static Silk.NET.Core.MaybeBool<T>.operator !=(T lh, Silk.NET.Core.MaybeBool<T> rh) -> bool
699+
static Silk.NET.Core.MaybeBool<T>.operator ==(Silk.NET.Core.MaybeBool<T> lh, T rh) -> bool
700+
static Silk.NET.Core.MaybeBool<T>.operator ==(T lh, Silk.NET.Core.MaybeBool<T> rh) -> bool
702701
static Silk.NET.Core.NullPtr.implicit operator void*(Silk.NET.Core.NullPtr _) -> void*
703702
static Silk.NET.Core.PointerExtensions.ReadToString(this Silk.NET.Core.Ptr<byte> this) -> string!
704703
static Silk.NET.Core.PointerExtensions.ReadToString(this Silk.NET.Core.Ptr<byte> this, int length) -> string!
@@ -935,13 +934,13 @@ static Silk.NET.Core.Ptr3D<T>.operator ==(T* lh, Silk.NET.Core.Ptr3D<T> rh) -> b
935934
static Silk.NET.Core.Ptr3D<T>.operator ==(T** lh, Silk.NET.Core.Ptr3D<T> rh) -> bool
936935
static Silk.NET.Core.Ptr3D<T>.operator ==(void* lh, Silk.NET.Core.Ptr3D<T> rh) -> bool
937936
static Silk.NET.Core.Ptr3D<T>.operator ==(void** lh, Silk.NET.Core.Ptr3D<T> rh) -> bool
937+
static Silk.NET.Core.Ptr<T>.explicit operator Silk.NET.Core.Ptr<T>(nint ptr) -> Silk.NET.Core.Ptr<T>
938938
static Silk.NET.Core.Ptr<T>.explicit operator Silk.NET.Core.Ptr<T>(nuint ptr) -> Silk.NET.Core.Ptr<T>
939939
static Silk.NET.Core.Ptr<T>.explicit operator Silk.NET.Core.Ptr<T>(Silk.NET.Core.Ref<T> ptr) -> Silk.NET.Core.Ptr<T>
940940
static Silk.NET.Core.Ptr<T>.explicit operator string!(Silk.NET.Core.Ptr<T> ptr) -> string!
941941
static Silk.NET.Core.Ptr<T>.implicit operator nint(Silk.NET.Core.Ptr<T> ptr) -> nint
942942
static Silk.NET.Core.Ptr<T>.implicit operator nuint(Silk.NET.Core.Ptr<T> ptr) -> nuint
943943
static Silk.NET.Core.Ptr<T>.implicit operator Silk.NET.Core.Ptr(Silk.NET.Core.Ptr<T> ptr) -> Silk.NET.Core.Ptr
944-
static Silk.NET.Core.Ptr<T>.implicit operator Silk.NET.Core.Ptr<T>(nint ptr) -> Silk.NET.Core.Ptr<T>
945944
static Silk.NET.Core.Ptr<T>.implicit operator Silk.NET.Core.Ptr<T>(Silk.NET.Core.NullPtr ptr) -> Silk.NET.Core.Ptr<T>
946945
static Silk.NET.Core.Ptr<T>.implicit operator Silk.NET.Core.Ptr<T>(Silk.NET.Core.Ptr ptr) -> Silk.NET.Core.Ptr<T>
947946
static Silk.NET.Core.Ptr<T>.implicit operator Silk.NET.Core.Ptr<T>(T* ptr) -> Silk.NET.Core.Ptr<T>

sources/Core/Core/Silk.NET.Core.csproj

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@
2424
<SilkTrackPublicAPI>true</SilkTrackPublicAPI>
2525
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
2626
</PropertyGroup>
27-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
28-
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
29-
</PropertyGroup>
30-
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
31-
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
32-
</PropertyGroup>
3327
<ItemGroup Condition="'$(TargetFramework)' != ''">
3428
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Shipped.txt" />
3529
<AdditionalFiles Include="PublicAPI/$(TargetFramework)/PublicAPI.Unshipped.txt" />

0 commit comments

Comments
 (0)