cxx2rs icon indicating copy to clipboard operation
cxx2rs copied to clipboard

Fails on lv2.h

Open badosu opened this issue 11 years ago • 6 comments

I am experimenting on Rust as an audio processing language, so I am trying to create a simple lv2 plugin.

The problem is that I am not able to process the header file to access lv2 interface, see:

This is the file: lv2.h

~/l/amp ❯❯❯ python2.7 ~/Code/cxx2rs/cxx2rs.py lv2 /usr/include/lv2.h

#![crate_type = "lib"]
#![crate_name = "ssh"]

extern crate libc;
use std::mem;

use std::collections::enum_set::CLike;


Traceback (most recent call last):
  File "/home/badosu/Code/cxx2rs/cxx2rs.py", line 74, in <module>
    main()
  File "/home/badosu/Code/cxx2rs/cxx2rs.py", line 47, in main
    print "/*\n%s*/" % stringify_function_declaration(func)
  File "/home/badosu/Code/cxx2rs/stringify.py", line 21, in stringify_function_declaration
    canonical_function_name(node),
  File "/home/badosu/Code/cxx2rs/parser.py", line 94, in canonical_function_name
    for p in parent_path(node):
  File "/home/badosu/Code/cxx2rs/parser.py", line 89, in parent_path
    res = parent_path(parent) + [parent]
  File "/home/badosu/Code/cxx2rs/parser.py", line 86, in parent_path
    if parent.spelling is None:
AttributeError: 'NoneType' object has no attribute 'spelling'

badosu avatar Feb 10 '15 12:02 badosu

I just pushed a new commit and tried compiling lv2.h. Worked fine here.

manuels avatar Feb 11 '15 20:02 manuels

I am sorry, i just pulled fab40a86fc65b9f003bb2f89e019a44f431c5185, and it still fails for me, see the gist. I must say that it is failing in a different place now, though.

Am I doing anything wrong?

badosu avatar Feb 13 '15 03:02 badosu

hmm, what does clang --version output on your system?

manuels avatar Feb 13 '15 09:02 manuels

Hi @manuels, it follows:

~ ❯❯❯ clang --version
clang version 3.5.1 (tags/RELEASE_351/final)
Target: x86_64-unknown-linux-gnu
Thread model: posix

badosu avatar Feb 13 '15 10:02 badosu

$ clang --version
Debian clang version 3.5.0-1~exp1 (trunk) (based on LLVM 3.5.0)
Target: x86_64-pc-linux-gnu
Thread model: posix

That is pretty strange!

manuels avatar Feb 19 '15 15:02 manuels

Is your version different? If you tell me which is, I can use it to make it work :-). Thanks for helping me out with this issue.

badosu avatar Feb 19 '15 16:02 badosu