[foreign-jextract] [Rev 01] RFR: 8238316: jextract emits a C_BOOL when source says char

Athijegannathan Sundararajan sundar at openjdk.java.net
Fri Feb 21 17:02:41 UTC 2020


On Fri, 21 Feb 2020 15:25:37 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> The pull request has been updated with 1 additional commit.
> 
> src/jdk.incubator.jextract/share/classes/jdk/incubator/jextract/tool/JavaSourceBuilder.java line 141:
> 
>> 140:                 }
>> 141:             } else {
>> 142:                 sb.append(switch (type) {
> 
> `long double` is a standard type, so it should be fine to support on other platforms as well. e.g. Windows: https://docs.microsoft.com/en-us/cpp/cpp/fundamental-types-cpp?view=vs-2019
> 
> Looks like the constant is just missing from MemoryLayouts.WinABI. Should be 8 bytes there.
> public static final ValueLayout C_LONGDOUBLE = MemoryLayout.ofValueBits(64, ByteOrder.LITTLE_ENDIAN)
>         .withAnnotation(AbstractLayout.NATIVE_TYPE, SystemABI.Type.LONG_DOUBLE);
> 
> Looks like on arm it is 16 bytes, so you can copy the impl from SysV.

Nice suggestion. Will add long double for other ABIs

-------------

PR: https://git.openjdk.java.net/panama-foreign/pull/25


More information about the panama-dev mailing list