From: Joel VanderWerf Date: 2009-09-14T02:13:34+09:00 Subject: Re: Using Data_Make_Struct for incomplete type Erik Lindblad wrote: > I have read up a bit on the problem and it is like I suspected. The > struct contains arrays of undeclared size and naturally the compiler > cannot guess the size. For now I have worked around it bu transferring > the struct data to VALUE instance variable, but that solution is not > as pretty as the option of wrapping the full struct. One more suggestion (maybe the same as what you just said): since the struct seems to be variable length, what about wrapping a pointer to the struct instead of the struct itself? In other words, the struct you wrap is of this type typedef struct { struct SomeOpaqueStruct *s; } MyStruct; where SomeOpaqueStruct is from the library. It's a bit less efficient, because of two dereferences (ruby object -> MyStruct -> s) and the extra allocation, but that's probably relatively small. -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407