Hi Ben and Phil,

Thanks for your replies.

On Sun, Dec 02, 2018 at 10:53:11PM +0800, Ben Coman wrote:
> One option could be to create a small shared library that you compile for each
> platform that just exported the member offsets... 
> https://www.embedded.com/design/prototyping-and-development/4024941/
> Learn-a-new-trick-with-the-offsetof--macro
> 
> You first FFI to that read struct member offsets and dynamically create the
> definitions for your target library.
> I haven't tried it in practice.
> 
> cheers -ben
> 
> P.S. Occasionally I dream about compilers being able to embed a pre-compiled
> header declaration block in the library for FFI users to iterate... 
> https://clang.llvm.org/docs/PCHInternals.html#declarations-block



On Sun, Dec 02, 2018 at 04:41:38PM +0100, [email protected] wrote:
> No, but what about FFIExternalPackedStructureTest  and FFITestStructure ?
> 
> Never tried with a typedef in the fieldsDesc but may work.
> 
> Phil


OK, it sounds like this still hasn't been adressed.

The other idea that we've discussed in the past is to supply human 
readable text files that describe the structures for each platform, e.g. 
a STON file.  The file would be generated by automatically creating a 
program that dumps the required information to the STON text file.  This 
would allow the definitions to be used on platforms that don't have a 
compiler or the dev versions of the libraries installed.  I think we 
could even use the current #fieldDesc methods to generate these programs 
(maybe with some additional information stored in the class).

A couple of links:

- 
http://forum.world.st/PATCH-added-FilePlugin-error-code-lookup-function-tp5071376p5071620.html
- 
http://forum.world.st/PATCH-added-FilePlugin-error-code-lookup-function-tp5071376p5075016.html


Thanks again,
Alistair


Reply via email to