2 // This tests checks that the compiler catches the special attributes
3 // for in a struct for CharSet, and turns the right bit on the TypeAttribute
6 using System.Reflection;
7 using System.Runtime.InteropServices;
9 [StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Unicode)]
12 [FieldOffset(0)] public float fh_float;
13 [FieldOffset(0)] public int fh_int;
16 [StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Ansi)]
19 [FieldOffset(0)] public float fh_float;
20 [FieldOffset(0)] public int fh_int;
22 [StructLayout(LayoutKind.Explicit, Size=32,CharSet=CharSet.Auto)]
25 [FieldOffset(0)] public float fh_float;
26 [FieldOffset(0)] public int fh_int;
34 Type t = typeof (MyUnicode);
36 if ((t.Attributes & TypeAttributes.UnicodeClass) != TypeAttributes.UnicodeClass){
37 Console.WriteLine ("Class MyUnicode does not have Unicode bit set");
42 if ((t.Attributes & TypeAttributes.AutoClass) != TypeAttributes.AutoClass){
43 Console.WriteLine ("Class MyAuto does not have Auto bit set");
49 if ((t.Attributes & TypeAttributes.AnsiClass) != TypeAttributes.AnsiClass){
50 Console.WriteLine ("Class MyUnicode does not have Ansi bit set");