bodensx / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

Fix for jnaerator with bridj: 1) varargs and 2) invalid parameter names #93

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I encountered a bug that I fixed (will close the issue when pushed).
It causes bad generation of java files when the bridj backend is used in 
jnaerator.

A simple example is the following C function:

    void ok2(int transient, ...);

With jnaerator-jna, all is fine and I get:

    void ok2(int transient$, Object... varargs);

With jnaerator-bridj, I used to get:

    public static native void ok2(int transient, void arg1);

Rémi

Original issue reported on code.google.com by remi-11-...@heeere.com on 9 Aug 2011 at 4:23

GoogleCodeExporter commented 8 years ago

Original comment by remi-11-...@heeere.com on 9 Aug 2011 at 5:06

GoogleCodeExporter commented 8 years ago

Original comment by remi-11-...@heeere.com on 9 Aug 2011 at 10:07

GoogleCodeExporter commented 8 years ago
Hello Remi,

Thanks a lot for your fix, this is really cool !
FYI, I've just moved the source repository to github, so here's the link to 
your (imported) commit :
https://github.com/ochafik/nativelibs4java/commit/74b59d5152333bf2d7f9d9613662f5
fc3c1ecaf2

Your fix is straightforward, except maybe for the `isObjectiveC NSObject.class 
: Object.class` : an Objective-C method should be able to receive primitives 
and pointers as arguments, shouldn't it ?

Regarding your comments, there is no equivalent for "alternativeOutputs" as for 
the JNA runtime : BridJ bindings are meant to be non-equivocal, there should be 
only one way to bind a given signature.

(I've removed the extra comments : 
https://github.com/ochafik/nativelibs4java/commit/a7bb9d97ae26a1b1b7a00034cc6510
422acff5a2 )

Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 12 Aug 2011 at 1:02