@@ -26,7 +26,8 @@ object Struct {
26
26
type point_s = native.Ptr [struct_point]
27
27
type struct_bigStruct = native.CArray [Byte , native.Nat .Digit [native.Nat ._1, native.Nat .Digit [native.Nat ._1, native.Nat ._2]]]
28
28
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]
30
31
type struct_packedStruct = native.CStruct1 [native.CChar ]
31
32
type struct_bitFieldStruct = native.CArray [Byte , native.Nat ._2]
32
33
type struct_bitFieldOffsetDivByEight = native.CArray [Byte , native.Nat ._4]
@@ -35,7 +36,8 @@ object Struct {
35
36
def createPoint (): native.Ptr [struct_point] = native.extern
36
37
def getBigStructSize (): native.CInt = native.extern
37
38
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
39
41
def struct_test_long (s : native.Ptr [struct_bigStruct], op : enum_struct_op, value : native.CLong ): native.CInt = native.extern
40
42
def struct_test_double (s : native.Ptr [struct_bigStruct], op : enum_struct_op, value : native.CDouble ): native.CInt = native.extern
41
43
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 {
111
113
def i_= (value : native.CInt ): Unit = ! p._2 = value
112
114
}
113
115
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
+
114
121
implicit class struct_structWithAnonymousStruct_ops (val p : native.Ptr [struct_structWithAnonymousStruct]) extends AnyVal {
115
122
def a : native.CInt = ! p._1
116
123
def a_= (value : native.CInt ): Unit = ! p._1 = value
117
124
def anonymousStruct : native.Ptr [struct_anonymous_0] = p._2
118
125
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
119
128
}
120
129
}
121
130
@@ -184,13 +193,24 @@ object Struct {
184
193
}
185
194
}
186
195
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
+
187
206
object struct_structWithAnonymousStruct {
188
207
import implicits ._
189
208
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] = {
191
210
val ptr = native.alloc[struct_structWithAnonymousStruct]
192
211
ptr.a = a
193
212
ptr.anonymousStruct = anonymousStruct
213
+ ptr.unnamed_0 = unnamed_0
194
214
ptr
195
215
}
196
216
}
0 commit comments