RFR: 7903947: Access to function pointers in structs could be streamlined

Duncan Gittins duncan.gittins at gmail.com
Fri Jul 25 09:25:18 UTC 2025


Now I think about it, renaming the invoker may be necessary after all.
The setter would be useful for applications to fill struct with Java
upcalls to implement callbacks. eg implementing COM api, rather than using
one.

Duncan

On Thu, 24 Jul 2025 at 16:05, Maurizio Cimadamore <mcimadamore at openjdk.org>
wrote:

> On Thu, 24 Jul 2025 13:52:05 GMT, Duncan Gittins <duncan.gittins at gmail.com>
> wrote:
>
> > Will the use of ",functional" be the intended way to trigger this
> > enhancement? I wonder whether last error capture could be built in with
> > "--include-function funcname,erro" or "--include-function
> > funcname,GetLastError"
>
> Nice connection -- we do in fact have plans (at least in theory) to use
> this same mechanism for errno -- and maybe even to declare "disjoint enums"
> (e.g. enums that can be modelled as plain Java enums because you swear not
> to rely on low-level bitmask operation -- which is often the case if the
> enum you are modelling is just a "tag")
>
> > This proposal makes it nicer to handle invokers. I generated my code with
> > this change but as you'vr noted it does indeed lead to clashes using the
> > proposed naming convention.
>
> I think the issue is that the changes in this PR generate both setter and
> invoker -- and we should only emit the invoker.
>
> -------------
>
> PR Comment:
> https://git.openjdk.org/jextract/pull/287#issuecomment-3113817281
> PR Comment:
> https://git.openjdk.org/jextract/pull/287#issuecomment-3113821975
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jextract-dev/attachments/20250725/6cb6c395/attachment-0001.htm>


More information about the jextract-dev mailing list