nativelibs4java / JNAerator

JNAerator: native bindings generator for JNA / BridJ / Node.js

Home Page:http://jnaerator.googlecode.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Misgeneration of byte[] for const char*

ochafik opened this issue · comments

From @shevek on January 6, 2015 18:44

int udev_enumerate_add_match_property(struct udev_enumerate *udev_enumerate, const char *property, const char *value);

misgenerates as

        /**
         * Original signature : <code>int udev_enumerate_add_match_property(udev_enumerate*, __declspec(property) const char*, const char*)</code><br>
         * <i>native declaration : /usr/include/libudev.h:172</i>
         */
        int udev_enumerate_add_match_property(UdevLibrary.udev_enumerate udev_enumerate, byte charPtr1[], String value);

I don't know where the other __declspec(property) came from, and this is a regression from before the new year.

Using https://oss.sonatype.org/content/repositories/snapshots/com/nativelibs4java/jnaerator/0.12-SNAPSHOT/jnaerator-0.12-20141230.103357-61.jar

All the other libraries I'm processing currently work, but the one that originally worked no longer does!

Adding '-Dproperty=name' to rename the variable makes this work, so something is special-casing on a variable name? That's very odd, and should probably be discouraged?

Copied from original issue: nativelibs4java/nativelibs4java#551