-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding some implicit conversion operators for LARGE_INTEGER and ULARG…
…E_INTEGER
- Loading branch information
1 parent
f5ca0d7
commit 25da5d5
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
20 changes: 20 additions & 0 deletions
20
sources/Interop/Windows/Windows/um/winnt/LARGE_INTEGER.Manual.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. | ||
|
||
// Ported from um/winnt.h in the Windows SDK for Windows 10.0.20348.0 | ||
// Original source is Copyright © Microsoft. All rights reserved. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
namespace TerraFX.Interop.Windows; | ||
|
||
public partial struct LARGE_INTEGER | ||
{ | ||
public static implicit operator long(LARGE_INTEGER value) => value.QuadPart; | ||
|
||
public static implicit operator LARGE_INTEGER(long value) | ||
{ | ||
Unsafe.SkipInit(out LARGE_INTEGER result); | ||
result.QuadPart = value; | ||
return result; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
sources/Interop/Windows/Windows/um/winnt/ULARGE_INTEGER.Manual.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. | ||
|
||
// Ported from um/winnt.h in the Windows SDK for Windows 10.0.20348.0 | ||
// Original source is Copyright © Microsoft. All rights reserved. | ||
|
||
using System.Runtime.CompilerServices; | ||
|
||
namespace TerraFX.Interop.Windows; | ||
|
||
public partial struct ULARGE_INTEGER | ||
{ | ||
public static implicit operator ulong(ULARGE_INTEGER value) => value.QuadPart; | ||
|
||
public static implicit operator ULARGE_INTEGER(ulong value) | ||
{ | ||
Unsafe.SkipInit(out ULARGE_INTEGER result); | ||
result.QuadPart = value; | ||
return result; | ||
} | ||
} |