Skip to content

Commit 207e5e1

Browse files
authored
Merge pull request #570 from ElektroKill/extended-type-layout
Add support for `TypeAttributes.ExtendedLayout`
2 parents b3060d8 + 73a4119 commit 207e5e1

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

src/DotNet/ExportedType.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,11 @@ public TypeAttributes Layout {
337337
/// </summary>
338338
public bool IsExplicitLayout => ((TypeAttributes)attributes & TypeAttributes.LayoutMask) == TypeAttributes.ExplicitLayout;
339339

340+
/// <summary>
341+
/// <c>true</c> if <see cref="TypeAttributes.ExtendedLayout"/> is set
342+
/// </summary>
343+
public bool IsExtendedLayout => ((TypeAttributes)attributes & TypeAttributes.LayoutMask) == TypeAttributes.ExtendedLayout;
344+
340345
/// <summary>
341346
/// Gets/sets the <see cref="TypeAttributes.Interface"/> bit
342347
/// </summary>

src/DotNet/TypeAttributes.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public enum TypeAttributes : uint {
3535
SequentialLayout = 0x00000008,
3636
/// <summary>Layout is supplied explicitly</summary>
3737
ExplicitLayout = 0x00000010,
38+
/// <summary>Layout is supplied via the System.Runtime.InteropServices.ExtendedLayoutAttribute</summary>
39+
ExtendedLayout = 0x00000018,
3840

3941
/// <summary>Use this mask to retrieve class semantics information.</summary>
4042
ClassSemanticsMask = 0x00000020,

src/DotNet/TypeDef.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,11 @@ public TypeAttributes Layout {
770770
/// </summary>
771771
public bool IsExplicitLayout => ((TypeAttributes)attributes & TypeAttributes.LayoutMask) == TypeAttributes.ExplicitLayout;
772772

773+
/// <summary>
774+
/// <c>true</c> if <see cref="TypeAttributes.ExtendedLayout"/> is set
775+
/// </summary>
776+
public bool IsExtendedLayout => ((TypeAttributes)attributes & TypeAttributes.LayoutMask) == TypeAttributes.ExtendedLayout;
777+
773778
/// <summary>
774779
/// Gets/sets the <see cref="TypeAttributes.Interface"/> bit
775780
/// </summary>

0 commit comments

Comments
 (0)