[erlang-questions] Passing data between Erlang and C port while preserving padding and alignment?

Frank Muller frank.muller.erl@REDACTED
Fri Dec 7 09:49:19 CET 2018


Hello Vance

Fantastic!!!

It would be great if you can share some code.
I’m totally lost with this tricky problem and no one was able to help me.

Thanks in advance...

/Frank

> On Fri, Dec 7, 2018 at 9:51 AM Frank Muller <frank.muller.erl@REDACTED>
> wrote:
> > Question: how can I derive the GCC's padding, and automatically add it
> to my Erlang binary?
>
> Frank,
>
> I used to write linked-in drivers for embedded systems which provided
> C library APIs. Back in those days I was building for 32 & 64 bit, x86
> & SPARC. I used GNU autotools to figure out the target environment and
> generate macros in my Erlang header files. It all worked quite
> smoothly in the end.  I'd be happy to send you an example project if
> you think it'd helpful.
>
> To your specific question I think the autoconf macro AC_CHECK_ALIGNOF
> does what you want:
>
> https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Generic-Compiler-Characteristics.html
>
> --
>      -Vance
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181207/684fed75/attachment.htm>


More information about the erlang-questions mailing list