hzzc1987 / jnaerator

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

not generated all apis from header file (unnamed "const char *const *" function arg crashes parser) #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I donwload vlc source code from
http://www.videolan.org/vlc/download-sources.html (Latest VLC source code
tarball (1.0.1))
2. use command line : java -jar jnaerator.jar  -noComp -noJar -noAuto
-package vlc.java.binding libvlc.h

3. the api "libvlc_new" in libvlc.h was not generated into LibvlcLibrary.java 

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
==I used Jnaerator build 621, winXP, JDK1.6.0_15

Please provide any additional information below.

Original issue reported on code.google.com by chunhaic...@gmail.com on 15 Sep 2009 at 7:56

GoogleCodeExporter commented 8 years ago
Hi,

Sorry for taking so long to answer, I missed the notification :-S
I will try to reproduce and fix your issue shortly.

In the meanwhile, I suggest that you don't use the -noAuto switch or that you 
replace 
it by a well-thought set of macro definitions (the automatic macros feature 
defines 
the architecture, compiler and platform settings which are needed by most 
low-level 
headers).

Also, did you try and inspect the output in verbose mode ? (-v switch)
And does the JNAerated output mention any "Skipped" item ?

Regards

Original comment by olivier.chafik@gmail.com on 1 Oct 2009 at 1:07

GoogleCodeExporter commented 8 years ago
Ok, so this is definitely a parsing bug, and there's a workaround :-)
The offending definition is :
{{{
VLC_PUBLIC_API libvlc_instance_t *
libvlc_new( int, const char *const *, libvlc_exception_t * p_e);
}}}
If edit libvlc.h and give a name to the second argument, everything goes fine :
{{{
VLC_PUBLIC_API libvlc_instance_t *
libvlc_new( int, const char *const * argv, libvlc_exception_t *);
}}}

I'm gonna go back to my ANTLR grammar :'-(

Regards

Original comment by olivier.chafik@gmail.com on 1 Oct 2009 at 8:51

GoogleCodeExporter commented 8 years ago

Original comment by olivier.chafik@gmail.com on 1 Oct 2009 at 8:53

GoogleCodeExporter commented 8 years ago
Fixed in revision #859 & latest jnaerator-0.9.2-SNAPSHOT.jar

Original comment by olivier.chafik@gmail.com on 1 Oct 2009 at 9:59