[foreign-jextract] RFR Add varargs support for jextract generated code

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Wed Jan 22 14:17:10 UTC 2020


Looks good - but there's an issue in the template changes - the template 
does explicit, platform-dependent layout imports:

+import static jdk.incubator.foreign.MemoryLayouts.SysV.C_DOUBLE;
+import static jdk.incubator.foreign.MemoryLayouts.SysV.C_LONG;
+import static jdk.incubator.foreign.MemoryLayouts.SysV.C_POINTER;

Now, when [1] will be fixed, you will be able to have a single set of 
static imports which will auto-resolve to the right constants. I think 
for now (and maybe in the future) we should use some kind of templating 
scheme here e.g.

import static ${C_LONG}

etc.

And then jextract will fill in with the layout it thinks are the correct 
one (at extraction time).

Maurizio

[1] https://bugs.openjdk.java.net/browse/JDK-8237545

On 22/01/2020 14:07, sundararajan.athijegannathan at oracle.com wrote:
> Please review.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8237646
>
> Webrev: 
> http://cr.openjdk.java.net/~sundar/minimal_jextract_varargs/webrev.00/
>
> PS. Piggybacking to add ToolProvider for jextract tool and basic test 
> framework with simple generation tests.
>
> Thanks,
>
> -Sundar
>


More information about the panama-dev mailing list