RFR: 7903923: Derive C_* layouts directly from the Linker [v3]

Nizar Benalla nbenalla at openjdk.org
Mon Jan 13 17:35:00 UTC 2025


On Mon, 13 Jan 2025 12:24:07 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:

> What's the story with primitive typedef? Do they work? I believe they will go back to stuff like JAVA_INT and such, instead of picking the layout constant we have already emitted. E.g.
>
> typedef int myInt

I do not think so. Instead `C_INT` derived from the canonical layout is used everywhere


cat test.h 
typedef long myLong;
typedef int myInt;

`jextract` generates the following code 


public static final OfLong myLong = test_h.C_LONG;
public static final OfInt myInt = test_h.C_INT;

I generated a couple of samples (sqlite3 and opengl) and do not see `JAVA_INT` anywhere, the only place where this string is found in the repo is the generated libclang folder.

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

PR Comment: https://git.openjdk.org/jextract/pull/269#issuecomment-2587748293


More information about the jextract-dev mailing list