[ffigen] Remove the built in flag from ObjC interfaces (#487)
diff --git a/pkgs/ffigen/CHANGELOG.md b/pkgs/ffigen/CHANGELOG.md index 1a577da..6f64cf7 100644 --- a/pkgs/ffigen/CHANGELOG.md +++ b/pkgs/ffigen/CHANGELOG.md
@@ -1,8 +1,14 @@ +# 7.2.1 + +- Fix helper methods sometimes missing from NSString. + # 7.2.0 + - Added support for sharing bindings using `symbol-file` config. (See `README.md` and examples/shared_bindings). # 7.1.0 + - Handle declarations with definition accessible from a different entry-point. # 7.0.0
diff --git a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart index d796763..e7f5bd5 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_built_in_functions.dart
@@ -311,7 +311,6 @@ (ObjCInterface( originalName: "NSData", builtInFunctions: this, - isBuiltIn: true, )); }
diff --git a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart index cda85ca..8ca0b8e 100644 --- a/pkgs/ffigen/lib/src/code_generator/objc_interface.dart +++ b/pkgs/ffigen/lib/src/code_generator/objc_interface.dart
@@ -44,7 +44,6 @@ final String lookupName; final ObjCBuiltInFunctions builtInFunctions; - final bool isBuiltIn; late final ObjCInternalGlobal _classObject; late final ObjCInternalGlobal _isKindOfClass; late final Func _isKindOfClassMsgSend; @@ -56,7 +55,6 @@ String? lookupName, String? dartDoc, required this.builtInFunctions, - required this.isBuiltIn, }) : lookupName = lookupName ?? originalName, super( usr: usr, @@ -64,13 +62,11 @@ name: name ?? originalName, dartDoc: dartDoc, ) { - if (isBuiltIn) { - builtInFunctions.registerInterface(this); - } + builtInFunctions.registerInterface(this); } - bool get isNSString => isBuiltIn && originalName == "NSString"; - bool get isNSData => isBuiltIn && originalName == "NSData"; + bool get isNSString => originalName == "NSString"; + bool get isNSData => originalName == "NSData"; @override BindingString toBindingString(Writer w) {
diff --git a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart index 16cec51..64f1e28 100644 --- a/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart +++ b/pkgs/ffigen/lib/src/header_parser/sub_parsers/objcinterfacedecl_parser.dart
@@ -75,7 +75,6 @@ lookupName: config.objcModulePrefixer.applyPrefix(name), dartDoc: getCursorDocComment(cursor), builtInFunctions: objCBuiltInFunctions, - isBuiltIn: cursor.isInSystemHeader(), ); }
diff --git a/pkgs/ffigen/pubspec.yaml b/pkgs/ffigen/pubspec.yaml index 1608ea8..c5d8d67 100644 --- a/pkgs/ffigen/pubspec.yaml +++ b/pkgs/ffigen/pubspec.yaml
@@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: ffigen -version: 7.2.0 +version: 7.2.1 description: Generator for FFI bindings, using LibClang to parse C header files. repository: https://github.com/dart-lang/ffigen