Appearance
| 1 | @@IF.dotnet() | |
| 2 | ||
| 3 | namespace Semantic is | |
| 4 | use System.Runtime.InteropServices.LayoutKind | |
| 5 | ||
| 6 | // What a type's `StructLayout` says: how its fields are laid out, | |
| 7 | // the alignment they are packed to, the size the type occupies, and | |
| 8 | // the character set strings in it are marshalled as. The runtime | |
| 9 | // reads these from the type's flags and its ClassLayout row rather | |
| 10 | // than from a custom attribute. A pack or size of 0 leaves the | |
| 11 | // runtime's default, and a char set of 0 leaves the type's own. | |
| 12 | class TYPE_LAYOUT( | |
| 13 | kind: LayoutKind public, | |
| 14 | pack: int public, | |
| 15 | size: int public, | |
| 16 | char_set: int public | |
| 17 | ) is | |
| 18 | is_explicit: bool => kind == LayoutKind.EXPLICIT | |
| 19 | si | |
| 20 | si |