hzzc1987 / jnaerator

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

Partial specialization file name #83

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a new file test.h containing

template <class T>
struct my_template<int> { 
    // A partial specialization
};

2. Run jnaerator
java -jar jnaerator-0.9.7-SNAPSHOT-shaded.jar -library Test test.h -o . -v 
-noJar -noComp

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

It fails to create the correct java file for the structure, because it tries to 
put angle brackets with the type in the filename.

Now parsing 1 text blocks
Normalizing parsed code...
Writing raw parsed sources to '_jnaerator.rawParsed.cpp'
Writing normalized parsed sources to '_jnaerator.normalizedParsed.cpp'
Generating libraries...
Struct with no field : my_template<int >
Generating my_template<int >.java
JNAeration failed !
java.io.FileNotFoundException: .\test\my_template<int >.java (The filename, 
directory name, or volume label syntax is incorrect)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.FileOutputStream.<init>(Unknown Source)
        at java.io.PrintWriter.<init>(Unknown Source)
        at com.ochafik.lang.jnaerator.JNAerator$3$1.<init>(JNAerator.java:795)
        at com.ochafik.lang.jnaerator.JNAerator$3.getClassSourceWriter(JNAerator.java:795)
        at com.ochafik.lang.jnaerator.JNAerator.getClassSourceWriter(JNAerator.java:745)
        at com.ochafik.lang.jnaerator.JNAerator$4.getClassSourceWriter(JNAerator.java:809)
        at com.ochafik.lang.jnaerator.DeclarationsConverter.outputConvertedStruct(DeclarationsConverter.java:1484)
        at com.ochafik.lang.jnaerator.DeclarationsConverter.convertStructs(DeclarationsConverter.java:1576)
        at com.ochafik.lang.jnaerator.JNAerator.fillLibraryMapping(JNAerator.java:1336)
        at com.ochafik.lang.jnaerator.JNAerator.generateJNALibraryFiles(JNAerator.java:1322)
        at com.ochafik.lang.jnaerator.JNAerator.generateLibraryFiles(JNAerator.java:1141)
        at com.ochafik.lang.jnaerator.JNAerator.jnaerationCore(JNAerator.java:1723)
        at com.ochafik.lang.jnaerator.JNAerator.jnaerate(JNAerator.java:831)
        at com.ochafik.lang.jnaerator.JNAerator$1.finished(JNAerator.java:721)
        at com.ochafik.lang.jnaerator.JNAeratorCommandLineArgs$ArgsParser.parse(JNAeratorCommandLineArgs.java:98)
        at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:292)
        at com.ochafik.lang.jnaerator.JNAerator.main(JNAerator.java:173)
Finished with errors.

What version of the product are you using? On what operating system?
Maven snapsot of 25/02/2011 (20110225010542)

Is the problem still present in the latest SVN version ? (you can easily
build from sources with these instructions :
http://code.google.com/p/javacl/wiki/Build)
Not tried yet, but tried with the last maven snapshot where the problem 
persists.

Please provide any additional information below.

Original issue reported on code.google.com by AODtoru...@gmail.com on 25 Feb 2011 at 1:58

GoogleCodeExporter commented 8 years ago
Hello,

Thanks for your report !
This definitely needs to be fixed (templates should be skipped for the JNA 
runtime output and handled properly for the BridJ runtime)

Cheers 
--
zOlive

Original comment by olivier.chafik@gmail.com on 13 Mar 2011 at 10:54

GoogleCodeExporter commented 8 years ago
Hi,
This issue moved to Github :
https://github.com/ochafik/nativelibs4java/issues/158

Thanks for not updating this page anymore and adding further comments on Github.
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 1 Sep 2011 at 7:27