compat.libffi
#includelibffi — portable foreign function interface, built from the upstream release
#include <ffi.h>
mcpp add compat.libffi@3.4.8
Usage
From this repository's own test project — built and run by CI, not written for the website.
// compat.libffi — behavioral test. It does not check that symbols exist; it
// builds a call frame at runtime and invokes through it, which is the only
// thing that proves the per-ABI assembly was assembled and linked correctly.
// A wrong or missing unix64.S links fine and segfaults here.
#ifdef __linux__
#include <ffi.h>
#include <dlfcn.h>
#include <cstdio>
#include <cstring>
#include <string>
namespace {
int failures = 0;
void check(bool ok, const char *what)
{
std::printf("%-58s %s\n", what, ok ? "ok" : "FAILED");
if (!ok) ++failures;
// …
tests/examples/libffi/tests/ffi.cpp · project tests/examples/libffi
Build
- targets
ffi (shared)- language
c++23- C standard
c11- import std
- no
- include dirs
include, src
Sources (12)
src/prep_cif.csrc/types.csrc/raw_api.csrc/java_raw_api.csrc/closures.csrc/tramp.csrc/x86/ffi.csrc/x86/ffi64.csrc/x86/ffiw64.csrc/x86/sysv.Ssrc/x86/unix64.Ssrc/x86/win64.S
Generated files
include/fficonfig.h