Upgrading ffigen 3 to 4
Breaking3.0.0 → 4.1.3Breaking3New5Changed3Fixed3
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- If you relied on the symbol-address setting to keep typedef names in native signatures, that no longer happens; turn on the new expose-typedefs setting instead.
- The code ffigen generates now follows the package:lints rules and keeps C symbol names unchanged, so linters may complain about those names.
- When two generated names clash, the extra number is now added directly to the name instead of after an underscore, so some generated names change.
Must act 3 items need code or config changes
Dart SDK requirement changed in 4.0.0: >=2.13.0 <3.0.0 → >=2.14.0 <3.0.0.
What you must change
Breaking3
Config key
function->symbol-address no longer exposes the typedef to Native type; use expose-typedefs instead.functionsymbol-addressexpose-typedefsGenerated code now targets package:lints and uses C symbol names as is, which may trigger lint warnings.
preambleName collisions are now resolved by suffixing
<int> instead of _<int>.API changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- changed:
ctor Library({ required String name, String? description, required this.bindings, String? header, bool dartBool = …, bool sort = …, StructPackingOverride? packingOverride, }) → ctor Library({ required String name, String? description, required List<Binding> bindings, String? header, bool dartBool = …, bool sort = …, StructPackingOverride? packingOverride, }) - changed:
field Library.bindings: final List<Binding> → field Library.bindings: late List<Binding> - changed:
get Config.structDependencies: StructDependencies → get Config.structDependencies: CompoundDependencies - changed:
method Library.operator ==(Object o): bool → method Library.operator ==(other): bool - added:
get Config.exposeFunctionTypedefs: Includer - added:
get Config.leafFunctions: Includer - added:
get Config.typedefs: Declaration - added:
get Config.unionDecl: Declaration - added:
get Config.unionDependencies: CompoundDependencies - added:
get Library.hashCode: int