You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We currently only support structs in GFFI which are defined at GPSEE compile
time. This is fine our POSIX-compatibility goal, but is a poor UX for users
wanting to use structs for third-party libraries.
The existing code works by identifying the following characteristics of each
struct at compile-time:
- Name of struct
- Name of each struct field
- Datatype of each struct field
- Size of each struct field
- Offset of each struct field
Once this information is known, GFFI can automatically reflect the entire
struct into a JS object.
I would like a nice API to update this internal data structure, so that native
modules built *outside of* of GPSEE (e.g. code in surelynx/gpsee-modules) can
declare new structs, efficiently.
Since we can still use the C compiler to help us figure out offsetOf(), etc, we
can still guarantee perfect compatibility across platforms, unlike solutions
which rely on JS-runtime struct injection.
It should be possible to basically re-use the struct declaration macros, etc,
in GFFI in another module and have everything "just work" to add new GFFI
functionality after a given module is loaded. Hopefully we can avoid
macro-copying, I would like to just #include them, probably via information in
outside.mk.
Original issue reported on code.google.com by wes@page.ca on 5 Sep 2012 at 3:37
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
wes@page.ca
on 5 Sep 2012 at 3:37The text was updated successfully, but these errors were encountered: