1
4
Fork
You've already forked libffi
1
A friendly libffi fork with a Zig build script and bindings. https://sourceware.org/libffi
C 65.6%
Assembly 32%
Zig 2.4%
Find a file
Alex Rønne Petersen 9ed26783a2
All checks were successful
/ build (x86_64-linux-gnu) (push) Successful in 38s
add Zig build script and bindings; remove all files unneeded in our fork
Co-authored-by: Techatrix <techatrix@mailbox.org>
2026年01月13日 22:33:46 +01:00
.forgejo/workflows add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
include add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
lib add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
src add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
.editorconfig add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
.gitattributes add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
.gitignore add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
.markdownlint.json add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
build.zig add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
build.zig.zon add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
example.zig add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
fficonfig.zig.h add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
LICENSE Update License date and improve rcedit DLL metadata ( #919 ) 2025年06月08日 06:16:38 -04:00
README.md add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00
RELEASE.md add Zig build script and bindings; remove all files unneeded in our fork 2026年01月13日 22:33:46 +01:00

Vezel libffi Fork

This is a friendly fork of libffi. The notable changes made in this fork are the additions of a Zig build script, making it easy to integrate libffi into Zig projects using the Zig package manager, and a set of idiomatic Zig bindings for libffi's main API. Additionally, to reduce the package download size, we have removed a large number of files that are unnecessary when using libffi in a Zig project. Importantly, all library source code is identical to upstream, so in terms of API/ABI compatibility, using this fork is no different from linking to a system libffi package.

Usage

The minimum Zig version supported by this project can be found in the minimum_zig_version field of the build.zig.zon file. We generally try to track the latest release of Zig. But do note that the master branch may sometimes contain code that only works with a master build of Zig.

Please note that the master branch is rebased on top of upstream periodically. You should use a release tag rather than master. For example:

zig fetch --save=libffi https://codeberg.org/vezel/libffi/archive/vX.Y.Z-B.tar.gz
# Or, to use Git:
zig fetch --save=libffi git+https://codeberg.org/vezel/libffi.git#vX.Y.Z-B

(You can find the latest version on the releases page.)

Consume the library in your build.zig:

constlibffi=b.dependency("libffi",.{.target=target,.optimize=optimize,});exe.root_module.addImport("ffi",libffi.module("ffi"));if(b.systemIntegrationOption("ffi",.{})){exe.root_module.linkSystemLibrary("ffi",.{});}else{exe.root_module.linkLibrary(libffi.artifact("ffi"));}

You can now use the Zig bindings in your code. See example.zig for basic usage.

License

This project is licensed under the terms found in LICENSE; this file is unchanged from upstream.