diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-11-25 14:55:58 +0100 |
---|---|---|
committer | Emilio Cobos Álvarez <emilio@crisal.io> | 2020-11-25 17:25:49 +0100 |
commit | 01cbe4468358d843ef86e3e9a1e8ce2bb4fef95e (patch) | |
tree | 92004612b710a8be4aed7d67a428aaa499d9765b /src/codegen/struct_layout.rs | |
parent | 7792d633c78d4ad39979e09a6215b656f7ec31f2 (diff) |
dyngen: Handle variadic functions.
Right now trying to generate a dynamic library with variadic functions
panics because we don't account for the extra `...` in the arguments.
Keeping the current interface for variadic functions is tricky, as we
cannot "wrap" a variadic function (VaList[1] is nightly-only).
However, we don't need to. We're already exposing the libloading error,
so exposing the function pointer field as public is just fine and allows
consumers to call the variadic function.
At that point the can_call() / CheckFoo libraries become pointless (you
can just do library.function.is_ok() or such), so we can simplify the
code as well removing those.
[1]: https://doc.rust-lang.org/std/ffi/struct.VaList.html
Diffstat (limited to 'src/codegen/struct_layout.rs')
0 files changed, 0 insertions, 0 deletions