Re: FFI newby question: importing C functions

  • From: Mike Pall <mike-1206@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 27 Jun 2012 12:52:57 +0200

QuentinC wrote:
> AS I guessed, the compiler exported round2 as round2@8.

The FFI looks for _round2@8 (with a prepended underscore),
because that's what the Microsoft docs tell us:

http://msdn.microsoft.com/en-us/library/zxk0tw93(v=vs.110).aspx

and that's what GCC generates on Windows for a __stdcall function:

[...]
.globl _round2@8
        .def    _round2@8;      .scl    2;      .type   32;     .endef
_round2@8:
[...]

--Mike

Other related posts: