sony / flutter-embedded-linux

Embedded Linux embedding for Flutter
BSD 3-Clause "New" or "Revised" License
1.16k stars 122 forks source link

flutter_elinux.h not C importable #345

Closed lhoward closed 11 months ago

lhoward commented 11 months ago

flutter_elinux.h appears to be C-compatible by virtue of its extern "C" guard but it includes some definitions with reference parameters:

FLUTTER_EXPORT FlutterDesktopViewControllerRef
FlutterDesktopViewControllerCreate(
    const FlutterDesktopViewProperties& view_properties,
    FlutterDesktopEngineRef engine);

FLUTTER_EXPORT FlutterDesktopEngineRef FlutterDesktopEngineCreate(
    const FlutterDesktopEngineProperties& engine_properties);

This causes problems with languages such as Swift that do not support C++ interoperability (at least, in shipping versions).

Upstream raised and fixed this in flutter/flutter#75465.

lhoward commented 11 months ago

Also would be nice to import FlutterDesktopMessengerAddRef and FlutterDesktopMessengerRelease if possible.

lhoward commented 11 months ago

Should be fixed in https://github.com/PADL/flutter-embedded-linux/tree/lhoward/345 (didn't create a PR, per README).

HidenoriMatsubayashi commented 11 months ago

Thank you. Can you please create a PR with Developer’s Certificate of Origin (DCO) in your commit message? Also, please update (AUTHORS)[https://github.com/sony/flutter-embedded-linux/blob/master/AUTHORS] too.

HidenoriMatsubayashi commented 11 months ago

Also would be nice to import FlutterDesktopMessengerAddRef and FlutterDesktopMessengerRelease if possible.

Remaining task.

lhoward commented 11 months ago

I will do, I need to figure out how to build it before trying anything more substantial.

HidenoriMatsubayashi commented 11 months ago

Okay, thank you.

HidenoriMatsubayashi commented 11 months ago

Closing. Thank you so much, Ihoward!

lhoward commented 11 months ago

Thank you for merging so quickly. I've tested the latest main with my Swift wrapper and it is working :)