This was reported in jextract-dev alias
https://mail.openjdk.org/pipermail/jextract-dev/2024-July/001843.html
The test file struct.h
#include <stdint.h>
typedef enum
{
EnumDef_Undefined = -1,
EnumDef_Big = 0x80000000
} EnumDef;
typedef struct structType
{
EnumDef someEnum;
uint64_t bigNumber;
} value;
On Mac and Linux, the layout generated is as follows:
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
foo_h.C_INT.withName("someEnum"),
foo_h.C_LONG.withName("bigNumber")
).withName("structType");
Layout on Windows is as follows:
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
struct_h.C_INT.withName("someEnum"),
MemoryLayout.paddingLayout(4),
struct_h.C_LONG_LONG.withName("bigNumber")
).withName("structType");
https://mail.openjdk.org/pipermail/jextract-dev/2024-July/001843.html
The test file struct.h
#include <stdint.h>
typedef enum
{
EnumDef_Undefined = -1,
EnumDef_Big = 0x80000000
} EnumDef;
typedef struct structType
{
EnumDef someEnum;
uint64_t bigNumber;
} value;
On Mac and Linux, the layout generated is as follows:
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
foo_h.C_INT.withName("someEnum"),
foo_h.C_LONG.withName("bigNumber")
).withName("structType");
Layout on Windows is as follows:
private static final GroupLayout $LAYOUT = MemoryLayout.structLayout(
struct_h.C_INT.withName("someEnum"),
MemoryLayout.paddingLayout(4),
struct_h.C_LONG_LONG.withName("bigNumber")
).withName("structType");
- links to
-
Commit(master) openjdk/jextract/9f0eacf3
-
Review(master) openjdk/jextract/252