-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generating Unions #358
Comments
The latest version of ffigen doesn't support generating unions as of now. I think we should probably wait till a beta (or atleast the next dev) dart sdk is released before we add support for generating unions. cc @dcharkes |
OK, thank you for the info.
Is there a way I can manually bind them as of now? I'm not sure I know
enough C to pull it off, but I'd be willing to give it a go.
Thanks in advance.
Take care,
Chris Norman
…On Wed, 12 May 2021 at 12:55, Prerak Mann ***@***.***> wrote:
The latest version of ffigen doesn't support generating unions as of now.
I think we should probably wait till a beta (or atleast the next dev) dart
sdk is released before we add support for generating unions.
cc @dcharkes <https://github.com/dcharkes>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#358>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBUZ2PYCJSXR6FSZ6GJKUDTNJUD7ANCNFSM44YNPS6A>
.
|
The last dev release, (Side note, we might want to wait with merging support for unions until after 2.13 stable comes out and we do a release for Dart 2.13 with packed structs etc. swapping to Dart stable and then after that land this swapping to Dart dev again.) |
Hi, @chrisnorman7 I've added a draft PR for union support, not sure when we'll merge it though. Until then you are welcome to use a git dependency to test it out. If you find any bugs, please do let us know. |
Hi,
That's great work, thank you.
I've had a brief look, but didn't see any docs for using it. Am I being
stupid? How does one use these unions?
Thanks for all your help, it's very much appreciated.
Take care,
Chris Norman
…On Fri, 14 May 2021 at 12:22, Prerak Mann ***@***.***> wrote:
Hi, @chrisnorman7 <https://github.com/chrisnorman7> I've added a draft PR
for union support, not sure when we'll merge it though.
Until then you are welcome to use a git dependency to test it out. If you
find any bugs, please do let us know.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#358>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBUZ2LQA46ZGJLVNDIZPGLTNUBYPANCNFSM44YNPS6A>
.
|
@chrisnorman7 Just regenerate the bindings using ffigen from the PR branch and ffigen will generate the unions (if any in your source). |
Thank you. I got them generated, and all that is working great.
I suppose I'm a bit confused as to how to use them once I've got them in
dart. This could well be a hole in my understanding of what unions do in C,
but I'm unsure if I'm supposed to do `if (u.member == null) for each
member, or something else?
Honestly, if this is covered elsewhere on the net, please just say. I am
more than happy to Google, I don't want to waste your time.
Take care,
Chris Norman
…On Tue, 18 May 2021 at 10:40, Prerak Mann ***@***.***> wrote:
@chrisnorman7 <https://github.com/chrisnorman7> Just regenerate the
bindings using ffigen from the PR branch and ffigen will generate the
unions (if any in your source).
You can include/exclude/rename/rename-members exactly like structs.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#358>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBUZ2KJNEECXMWN32J4QYDTOIYY5ANCNFSM44YNPS6A>
.
|
Yeah, you should probably check out how unions work in C. |
OK, no problem. Thank you so much.
Take care,
Chris Norman
…On Tue, 18 May 2021 at 10:44, Prerak Mann ***@***.***> wrote:
Yeah, you should probably check out how unions work in C.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#358>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBUZ2PVZ5CJ4GNV2ZKBWSLTOIZIZANCNFSM44YNPS6A>
.
|
@chrisnorman7 you can now depend on the prerelease from pub: https://pub.dev/packages/ffigen/versions/3.1.0-dev.0 |
Lovely, thank you so much.
Take care,
Chris Norman
…On Thu, 20 May 2021 at 11:35, Daco Harkes ***@***.***> wrote:
@chrisnorman7 <https://github.com/chrisnorman7> you can now depend on the
prerelease from pub: https://pub.dev/packages/ffigen/versions/3.1.0-dev.0
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#358>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBUZ2O4H2DGUJJEKX4Y74LTOTQYDANCNFSM44YNPS6A>
.
|
* Update Dart API * Remove unnecessary methods in dartjni.h
* Update Dart API * Remove unnecessary methods in dartjni.h
* ObjC interface registry * Don't remove trailing underscores from method names * Move isInSystemHeader to cursor utils * Fix analysis * Merge
Hi,
I apologise if there is already an issue for this, but either Google isn't being helpful, or I don't understand enough of the terminology to know what I'm looking at.
I'm in the process of trying to write bindings for SDL, and I'm running into issues.
SDL uses a union SDL_Event, and obviously ffigen isn't generating it.
From my research, it seems as though Union support is coming, but certainly hasn't filtered down to 2.13 as of yet. Is this true? Is there a way I can test the latest ffigen if I switch to Flutter Master?
Thanks in advance.
The text was updated successfully, but these errors were encountered: