# Changelog — mpv-bindgen-sys
## Unreleased
### Changed
- Regenerated with hs-bindgen 1.0.0.0.
- Raw modules (`Mpv.Sys.Bindgen.*`): each foreign import sits behind a
wrapper that converts argument by argument through `HasFFIType` and keeps
the original C signature; structs gain `IsStruct` instances; every module
is `NoImplicitPrelude` with an explicit `Prelude` import list.
- Writing a union member through `setField` of its
`GHC.Records.Compat.HasField` instance (`Mpv_node_u`, ...) now has
`payload -> union -> union` semantics: it copies the existing bytes, then
pokes the member. It used to write into a fresh uninitialised byte array.
- The vendored runtime is updated to hs-bindgen-runtime 1.0.0.0, with
matching `Mpv.Sys.Bindgen.Runtime.*` facades. New modules: `HasFFIType`,
`Macro`, `Overloading`, `Struct`. Removed: `Support.FFIType`,
`Support.HasFFIType`. They were private (no facade), so no consumer could
import them.
- `template-haskell >= 2.19` for the vendored runtime.
- Exported names, signatures and export lists of all pre-existing modules are
unchanged, apart from names added to the runtime facades; the raw foreign
imports changed only internally.
## 0.0.0.1 - TBD
Initial release: generated from libmpv client API 2.5.0 (mpv 0.41.0);
supports API >= 2.0 with version-gated wrappers for `mpv_del_property`
(2.1) and `mpv_get_time_ns` (2.2).
- Raw bindings (`Mpv.Sys.Bindgen.*`) and the curated alias layer
(`Mpv.Sys.*`) for `client.h`, `render.h`, `render_gl.h`, and
`stream_cb.h`, generated by a modified `hs-bindgen`.
- Below client API 2.1, `mpv_del_property` returns
`MPV_ERROR_UNSUPPORTED`; below 2.2, `mpv_get_time_ns` is polyfilled
from `mpv_get_time_us`. Gates verified by compiling every wrapper TU
and the ABI assertion TU against client API 2.0 and 2.1 header sets
(the 2.5 headers with the newer declarations removed); the CI consumer
job on Ubuntu 24.04 (client API 2.2) is the standing proof.
- Per-function safe/unsafe curation with rationales. Functions that run
a callback during the call export only their `Safe` alias.
- `mpv_client_api_version` is not bound (`unsigned long` has no portable
FFI type across LP64 and LLP64); see the README.
- Build flags, as in `sdl3-bindgen-sys`:
- `abi-assertions` (default on) - check the baked layouts against your
libmpv headers at build time.
- `abi-assertions-exact` (default off) - assert every `sizeof` exactly.
- `strict-data` (default on) - apply `StrictData` to generated modules.
- `strict` (default off) - **experimental** - apply `Strict` to
generated modules.
- `optimize` (default on) - compile the library with -O2.
- `optimize-aggressively` (default off) - release-mode; forces GHC to
apply very expensive optimizations to the library.
- ABI static assertions (`cbits/abi_assertions.c`, cabal flag
`abi-assertions`, default on): enforce that the building system's
libmpv headers match the layouts `hs-bindgen` built in.