Here are the main changes in this version :

  • (almost) Full support for BridgeSupport files : automatically found and parsed when using a -framework XXX command (direct path can also be specified), automatic 32 bits / 64 bits types reconciliation (float/double -> CGFloat, int/long long -> NativeLong…)
  • Extraction, demangling and parsing of DLL symbols : lets you reverse engineer simple globals and C++-decorated functions + static methods (no structure reverse-engineering yet, no instance methods call support, no support for C functions (__cdecl / extern “C”).

    Support of MachO/Fat is being worked on.

  • Updated Structure and Union runtime classes :
    • toArray() now return typed arrays
    • byReference() and byValue() are now defined in base Structure/Union class but are still correctly typed
  • Better C++ parsing (added ‘friend’ keyword, added experimental C++ code generation with the -genCPlusPlus switch : has no runtime support yet)
  • Support for very simple (non-virtual) C++ structs inheritance :

    struct Base {
    int a;
    };
    struct Derivate : Base {
    float f;
    }
    

    is JNAerated as :

    public static class Base extends com.ochafik.lang.jnaerator.runtime.Structure<base , Base.ByValue, Base.ByReference> {
    public int a;
    public Base() {
        super();
    }
    public Base(int a) {
        super();
        this.a = a;
    }
    protected ByReference newByReference() { return new ByReference(); }
    protected ByValue newByValue() { return new ByValue(); }
    protected Base newInstance() { return new Base(); }
    public static class ByReference extends Base implements com.sun.jna.Structure.ByReference {}
    public static class ByValue extends Base implements com.sun.jna.Structure.ByValue {}
    }
    public static class Derivate extends test.TestLibrary.Base {
    public float f;
    public Derivate() {
        super();
    }
    /// @param a @see test.TestLibrary.Base#a
    public Derivate(int a, float f) {
        super(a);
        this.f = f;
    }
    protected Derivate newInstance() { return new Derivate(); }
    public static class ByReference extends Derivate implements com.sun.jna.Structure.ByReference {}
    public static class ByValue extends Derivate implements com.sun.jna.Structure.ByValue {}
    }
    

    </base>```

  • wchar_t mapped as char (unless -wcharAsShort is used), as hinted by Timothy Wall
  • Updated global variables runtime support for primitive types (disabled in -direct mode, for now).
  • All JNAerated JARs now include JNAerator’s runtime (including JNA and, if needed, Rococoa)
  • New inline help, synchronized with its corresponding wiki page
  • New command line arguments
  • Fixed bit fields support in runtime library : now works like a charm, except for long long fields that have a non-null bit-offset (to be fixed soon, but most people won’t care)
  • Added a FAQ, which shows how simple the command line syntax has become

You can try the new features via JNAeratorStudio, as usual, or visit JNAerator’s project page.