Skip to content

Releases: JupiterRider/ffi

v0.6.0

11 Feb 20:59

Choose a tag to compare

Added

  • Support for linux/riscv64 added #15.

Changed

  • Dependency github.com/ebitengine/purego updated (required for linux/riscv64).

v0.5.1

29 Jul 18:00

Choose a tag to compare

Fixed

  • DefaultAbi had a wrong value on Windows ARM64.
  • Missing extra field attached to Cif (Windows/macOS ARM64).
  • Embedded libffi binaries have been updated to 3.5.1.

v0.5.0

10 Jun 17:40

Choose a tag to compare

Added

  • The libffi shared libraries for Windows AMD64 and macOS AMD64/ARM64 are now embedded into this library (#12).
    The build tag ffi_no_embed or the environment variable FFI_NO_EMBED=1 can disable this feature.
  • You can now retrieve the used libffi version (requires libffi 3.5.0 or newer):
    • func GetVersion() string
    • func GetVersionNumber() uint64
  • Function func GetStructOffsets(abi Abi, structType *Type, offsets *uint64) Status implemented.

Changed

  • Dependency github.com/ebitengine/purego updated.

v0.4.1

12 May 15:47

Choose a tag to compare

Fixed

  • The dependency github.com/ebitengine/purego had to be upgraded to version 0.8.3 due to a bug in Go 1.23.9 and 1.24.3.

v0.4.0

13 Mar 17:40

Choose a tag to compare

Changed

  • Fun.Call panics now, if the number of arguments doesn't match the prepared Cif.

v0.3.0

18 Jan 17:29

Choose a tag to compare

Added

  • libffi's closure API has been implemented, which allows you to create C functions at runtime:
    • func ClosureAlloc(size uintptr, code *unsafe.Pointer) *Closure
    • func ClosureFree(writable *Closure)
    • func PrepClosureLoc(closure *Closure, cif *Cif, fun uintptr, userData, codeLoc unsafe.Pointer) Status
  • The new types Fun and Lib can reduce boilerplate and eliminate platform-dependent code:
    • func (f Fun) Call(ret any, args ...any)
    • func Load(name string) (l Lib, err error)
    • func (l Lib) Close() error
    • func (l Lib) Get(name string) (addr uintptr, err error)
    • func (l Lib) Prep(name string, ret *Type, args ...*Type) (f Fun, err error)
    • func (l Lib) PrepVar(name string, nFixedArgs int, ret *Type, args ...*Type) (f Fun, err error)
  • New method func (a Arg) Bool() bool added.
  • Changelog file added.

Changed

  • On Linux, libffi.so.7 was loaded when libffi.so.8 could not be found. This is no longer the case.