Nested structs and unions: bad layout path
Tornai András
tornaiandrasede at gmail.com
Thu Oct 15 18:17:00 UTC 2020
Hello,
jextract generated the java classes from a .h file but at runtime the
following exception is thrown:
Caused by: java.lang.IllegalArgumentException: Bad layout path: cannot
resolve 'flags2' in layout [b32(flags3)[layout/name=flags3]])
I've attached the .h file, the executed commands and the output.
Regards,
András
-------------- next part --------------
#ifndef PBUG_H
#define PBUG_H
typedef struct PARAMS {
union {
struct {
int flags1;
union {
struct {
int flags3;
} Struct2;
} DUMMYUNION1;
} Struct1;
struct {
int flags2;
} Struct2;
} DUMMYUNION2;
} PARAMS;
#endif // PBUG_H
-------------- next part --------------
java --version
jextract --source -C "--verbose" -d src\main\java "pbug.h"
rd /s /q target
mkdir target\classes
javac --source 16 --add-modules jdk.incubator.foreign -d target\classes src\main\java\*.java
java -classpath target\classes --enable-preview --add-modules jdk.incubator.foreign -Dforeign.restricted=permit PBugApp
More information about the panama-dev
mailing list