AaronRobinsonMSFT / DNNE

Prototype native exports for a .NET Assembly.
MIT License
394 stars 41 forks source link

Export static variable entry points #146

Closed tonyvfish closed 1 year ago

tonyvfish commented 1 year ago

Hello I am looking at working with the new CLAP audio plugin and its export definition is CLAP_EXPORT extern const clap_plugin_entry_t clap_entry; A static variable and not a function Is it possible in someway to do this from managed code, export a static variable and not a function ?

https://github.com/git-moss/clap-tutorials/blob/main/src/moss-main.c see line 347

Edit - direct reference https://github.com/git-moss/clap-tutorials/blob/53c4f72b9b3d3c4acdbe7e35774fe186042db46d/src/moss-main.c#L347-L352

AaronRobinsonMSFT commented 1 year ago

@tonyvfish Unfortunately no there isn't, at least at present. This has been a request though previously, perhaps @jkotas recalls where. DNNE does support including additional translation units (that is, C files). It would be entirely possible to have that included in the final binary but would need to be written in C.

I believe NativeAOT supports this, but that is also something that I would defer to @jkotas.

Regardless, if anyone has a suggestion on how this might work I am more than willing to add support.

jkotas commented 1 year ago

NativeAOT does not support this either.

Including additional C file is the only way to do this.

AaronRobinsonMSFT commented 1 year ago

@tonyvfish I am going to close this as there are no present plans to add this feature. I've updated the FAQ with how it could be achieved and the current recommended approach.

tonyvfish commented 1 year ago

Thank you Aaron

On Thu, 16 Feb 2023, 18:37 Aaron Robinson, @.***> wrote:

@tonyvfish https://github.com/tonyvfish I am going to close this as there are no present plans to add this feature. I've updated the FAQ https://github.com/AaronRobinsonMSFT/DNNE#faqs with how it could be achieved and the current recommended approrach.

— Reply to this email directly, view it on GitHub https://github.com/AaronRobinsonMSFT/DNNE/issues/146#issuecomment-1433543337, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASDVCZE3FU25U22HDKZA3CTWXZXU5ANCNFSM6AAAAAAUVPBBSI . You are receiving this because you were mentioned.Message ID: @.***>