[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Map C bit-field to Gambas datatype


>
> So then, for this structure [
> https://mongoose.ws/documentation/#struct-mg_connection] (which would be
> received by a Gambas Sub
> as an event handler/callback in this example [
> https://mongoose.ws/documentation/tutorials/http-server/#a-minimal-static-server],
>
> I could simply declare the unsigned integers as Integers or even Bytes?
>
> Or, should I declare the connection parameter not as a structure but as a
> pointer and just pass it along as is, and IF I need to
> access it's fields use pointer arithmetic based on the SizeOf the
> datatypes?
>

Arghh.... Looking a bit more into this and it really is implementation
specific. IE you cannot trust on how the data is passed in the structure.
Surely you could get this work, but it might change depending on the
compiler, etc. Not worth it.

Jussi

References:
Map C bit-field to Gambas datatypeT Lee Davidson <t.lee.davidson@xxxxxxxxx>
Re: Map C bit-field to Gambas datatypeJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: Map C bit-field to Gambas datatypeT Lee Davidson <t.lee.davidson@xxxxxxxxx>