@@ -26,7 +26,8 @@ object Struct {
2626 type point_s = native.Ptr [struct_point]
2727 type struct_bigStruct = native.CArray [Byte , native.Nat .Digit [native.Nat ._1, native.Nat .Digit [native.Nat ._1, native.Nat ._2]]]
2828 type struct_anonymous_0 = native.CStruct2 [native.CChar , native.CInt ]
29- type struct_structWithAnonymousStruct = native.CStruct2 [native.CInt , struct_anonymous_0]
29+ type struct_anonymous_1 = native.CStruct1 [native.CInt ]
30+ type struct_structWithAnonymousStruct = native.CStruct3 [native.CInt , struct_anonymous_0, struct_anonymous_1]
3031 type struct_packedStruct = native.CStruct1 [native.CChar ]
3132 type struct_bitFieldStruct = native.CArray [Byte , native.Nat ._2]
3233 type struct_bitFieldOffsetDivByEight = native.CArray [Byte , native.Nat ._4]
@@ -35,7 +36,8 @@ object Struct {
3536 def createPoint (): native.Ptr [struct_point] = native.extern
3637 def getBigStructSize (): native.CInt = native.extern
3738 def getCharFromAnonymousStruct (s : native.Ptr [struct_structWithAnonymousStruct]): native.CChar = native.extern
38- def getIntFromAnonymousStruct (s : native.Ptr [struct_structWithAnonymousStruct]): native.CChar = native.extern
39+ def getIntFromAnonymousStruct (s : native.Ptr [struct_structWithAnonymousStruct]): native.CInt = native.extern
40+ def getFieldOfUnnamedStruct (s : native.Ptr [struct_structWithAnonymousStruct]): native.CInt = native.extern
3941 def struct_test_long (s : native.Ptr [struct_bigStruct], op : enum_struct_op, value : native.CLong ): native.CInt = native.extern
4042 def struct_test_double (s : native.Ptr [struct_bigStruct], op : enum_struct_op, value : native.CDouble ): native.CInt = native.extern
4143 def struct_test_point (s : native.Ptr [struct_bigStruct], op : enum_struct_op, value : native.Ptr [struct_point]): native.CInt = native.extern
@@ -111,11 +113,18 @@ object Struct {
111113 def i_= (value : native.CInt ): Unit = ! p._2 = value
112114 }
113115
116+ implicit class struct_anonymous_1_ops (val p : native.Ptr [struct_anonymous_1]) extends AnyVal {
117+ def b : native.CInt = ! p._1
118+ def b_= (value : native.CInt ): Unit = ! p._1 = value
119+ }
120+
114121 implicit class struct_structWithAnonymousStruct_ops (val p : native.Ptr [struct_structWithAnonymousStruct]) extends AnyVal {
115122 def a : native.CInt = ! p._1
116123 def a_= (value : native.CInt ): Unit = ! p._1 = value
117124 def anonymousStruct : native.Ptr [struct_anonymous_0] = p._2
118125 def anonymousStruct_= (value : native.Ptr [struct_anonymous_0]): Unit = ! p._2 = ! value
126+ def unnamed_0 : native.Ptr [struct_anonymous_1] = p._3
127+ def unnamed_0_= (value : native.Ptr [struct_anonymous_1]): Unit = ! p._3 = ! value
119128 }
120129 }
121130
@@ -184,13 +193,24 @@ object Struct {
184193 }
185194 }
186195
196+ object struct_anonymous_1 {
197+ import implicits ._
198+ def apply ()(implicit z : native.Zone ): native.Ptr [struct_anonymous_1] = native.alloc[struct_anonymous_1]
199+ def apply (b : native.CInt )(implicit z : native.Zone ): native.Ptr [struct_anonymous_1] = {
200+ val ptr = native.alloc[struct_anonymous_1]
201+ ptr.b = b
202+ ptr
203+ }
204+ }
205+
187206 object struct_structWithAnonymousStruct {
188207 import implicits ._
189208 def apply ()(implicit z : native.Zone ): native.Ptr [struct_structWithAnonymousStruct] = native.alloc[struct_structWithAnonymousStruct]
190- def apply (a : native.CInt , anonymousStruct : native.Ptr [struct_anonymous_0])(implicit z : native.Zone ): native.Ptr [struct_structWithAnonymousStruct] = {
209+ def apply (a : native.CInt , anonymousStruct : native.Ptr [struct_anonymous_0], unnamed_0 : native. Ptr [struct_anonymous_1] )(implicit z : native.Zone ): native.Ptr [struct_structWithAnonymousStruct] = {
191210 val ptr = native.alloc[struct_structWithAnonymousStruct]
192211 ptr.a = a
193212 ptr.anonymousStruct = anonymousStruct
213+ ptr.unnamed_0 = unnamed_0
194214 ptr
195215 }
196216 }
0 commit comments