jextract on Windows

Duncan Gittins duncan.gittins at gmail.com
Wed Feb 14 19:35:21 UTC 2024


You are right - I have old LLVM 9.0.0. I shall upgrade. Thanks for checking.

Big thank you to everyone involved with work for JDK22 - the new generated
code is tidier and nice without $get/set. So far all my Windows apps work
fine after making a few changes in my code to match the new structure.

I do have another issue with the unrealistic code generation case - that is
when using raw windows headers without --include-xxxx filtering. I'll
report back if it is an issue once I've updated LLVM and studied it more. I
only use that when trying out new APIs.

Dunc

On Wed, 14 Feb 2024 at 19:05, Maurizio Cimadamore <
maurizio.cimadamore at oracle.com> wrote:

> Hi Duncan,
> thanks for the report. I think the problem here is that we have updated
> jextract to use libclang directly for generating these comment.
>
> Now, in libclang 13, we get something like "unnamed union ...". We look
> for that string in the jextract code, and if we see that, we generate a
> more succinct comment.
>
> But you are running either a newer, or an older version, and it seems like
> instead of saying "unnamed" you get "anonymous" instead, which jextract is
> not looking for :-)
>
> So... we should probably make that logic/regex more robust.
>
> Maurizio
> On 14/02/2024 16:42, Duncan Gittins wrote:
>
> I've just pulled the latest jextract master branch (I think!), and re-run
> my build for JDK22 on Windows.
>
> Please ignore if you are mid-way though any fixes or already known issue.
> There appears to be a glitch with the snippet generation. If any component
> of an include file starts with "u", it is treated as an invalid \uXXXX
> character sequence by javac
>
>     /**      * Setter for field:      * {@snippet lang=c :      * union
> (anonymous union at C:\Program Files (x86)\Windows
> Kits\10\include\10.0.18362.0\um\winnt.h:16446:5) Flags      * }      */
>
> PROCESSOR_IDLESTATE_POLICY.java:222: error: illegal unicode escape
> [javac]      * union (anonymous union at C:\Program Files (x86)\Windows
> Kits\10\include\10.0.18362.0\um\winnt.h:16446:5) Flags     [javac]
>
> It's from jextract without symbol filters, but not on any definitions I
> use:
>
>     #include <shlobj_core.h>
>     #include <objbase.h>
>
> Kind regards
>
> Duncan
>
>
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/jextract-dev/attachments/20240214/259a1290/attachment-0001.htm>


More information about the jextract-dev mailing list