[ffigen] Add a warning message to objective C support (#292)
* Add a warning message to objective C support
* Upgrade warning to severe, and add to readme
diff --git a/pkgs/ffigen/README.md b/pkgs/ffigen/README.md
index 32137b9..3665b12 100644
--- a/pkgs/ffigen/README.md
+++ b/pkgs/ffigen/README.md
@@ -483,6 +483,20 @@
'dart-type': 'CustomType3'
```
</td>
+ <tr>
+ <td>language</td>
+ <td>
+ <b>WARNING:</b> Other language support is EXPERIMENTAL. The API may change
+ in a breaking way without notice.
+ <br><br>
+ Choose the input langauge. Must be one of 'c', or 'objc'. Defaults to 'c'.
+ </td>
+ <td>
+
+```yaml
+language: 'objc'
+```
+ </td>
</tr>
</tbody>
</table>
diff --git a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart
index aff84b2..9d7263e 100644
--- a/pkgs/ffigen/lib/src/config_provider/spec_utils.dart
+++ b/pkgs/ffigen/lib/src/config_provider/spec_utils.dart
@@ -464,7 +464,12 @@
bool languageValidator(List<String> name, dynamic value) {
if (value is String) {
- if (value == strings.langC || value == strings.langObjC) {
+ if (value == strings.langC) {
+ return true;
+ }
+ if (value == strings.langObjC) {
+ _logger.severe('Objective C support is EXPERIMENTAL. The API may change '
+ 'in a breaking way without notice.');
return true;
}
_logger.severe("'$name' must be one of the following - "