There is Runtime.calculateStructAlignment which calculates the offsets of
fields given the types of the fields, basically (it calculates padding and
alignment and so forth). I was thinking that could help here perhaps. It
would need some refactoring most likely.

- Alon



On Wed, Mar 5, 2014 at 6:18 PM, Mark Hahn <[email protected]> wrote:

> > Won't you need people to define C structures in JS for this to work?
>
> Yes, you have to copy the struct definitions from headers file to a custom
> js file.  I find it easy myself but others may have problems with this.  In
> the future if anyone finds this useful a real parser could be added that
> would just read the .h file.
>
> > Sounds like it will need to handle alignment issues too, unless the
> user is responsible?
>
> It just has to match whatever emscripten generates and the user shouldn't
> have to worry about it.  I may be wrong.
>
> >  We have code for that in Runtime which can help.
>
> Can you elaborate?  I would happily abandon this if there was already a
> solution.
>
>
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "emscripten-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to