nativelibs4java / JNAerator

JNAerator: native bindings generator for JNA / BridJ / Node.js
http://jnaerator.googlecode.com
507 stars 109 forks source link

Global structures not being generated right in JNA mode #81

Open ochafik opened 9 years ago

ochafik commented 9 years ago

From @shevek on December 24, 2014 23:28

0.12-SNAPSHOT

/home/shevek/java/udev4j/parted/build/generated-sources/jnaerator/org/anarres/device/parted/generated/PartedLibrary.java:1207: error: type argument PedAlignment is not within bounds of type-variable S
        public static final GlobalStruct<PedAlignment > ped_alignment_any = new GlobalStruct<PedAlignment >(PartedLibrary.JNA_NATIVE_LIB, PedAlignment.class, "ped_alignment_any");
                                         ^
  where S is a type-variable:
    S extends Structure<?,?,?> declared in class GlobalStruct

This also kills stdio, and a few other things.

public class PedAlignment extends Structure {

Do not grok.

Copied from original issue: ochafik/nativelibs4java#546

ochafik commented 9 years ago

From @shevek on December 24, 2014 23:29

Because the Structure that JNAerator's GlobalStruct extends is com.ochafik.lang.jnaerator.runtime.Structure but the structure which PedAlignment extends is com.sun.jna.Structure

ochafik commented 9 years ago

From @shevek on December 24, 2014 23:30

Invoking jnaerator [-library, parted, -package, org.anarres.device.parted.generated, /usr/include/parted/parted.h, -mode, Directory, -runtime, JNA, -o, /home/shevek/java/udev4j/parted/build/generated-sources/jnaerator, -f, -v, -Dtime_t=long, -D_STDIO_H=1]

Note that -runtime JNA was used, not -runtime JNAerator