Re: [pygccxml-development] inline asm
Brought to you by:
mbaas,
roman_yakovenko
|
From: Matthias B. <mat...@gm...> - 2008-08-17 08:40:56
|
Thomas Rab wrote:
> earlier though. Can I do this for instance:
> inlineASM = mb.namespace("foo").class_("NxMath").member_function("bar")
> inlineASM.exclude()
Well, assuming that gccxml could parse the files then yes, this should
work. But the problem is that your script never gets to this line
because of the errors you are seeing.
> Right now because of this function I can't generate any code at all.
> Here is the error I get:
>
> C:/Program Files/NVIDIA Corporation/NVIDIA PhysX
> SDK/v2.8.1/SDKs/Foundation/include/NxMath.h: In
> static member function `static void NxMath::sinCos(float, NxF32&,
> NxF32&)':
> C:/Program Files/NVIDIA Corporation/NVIDIA PhysX
> SDK/v2.8.1/SDKs/Foundation/include/NxMath.h:744: error: `
> _asm' undeclared (first use this function)
> C:/Program Files/NVIDIA Corporation/NVIDIA PhysX
> SDK/v2.8.1/SDKs/Foundation/include/NxMath.h:744: error: (Each
> undeclared identifier is reported only once for each function it appears
> in.)
> C:/Program Files/NVIDIA Corporation/NVIDIA PhysX
> SDK/v2.8.1/SDKs/Foundation/include/NxMath.h:744: error: syntax
> error before `local'
You didn't post the full error message (I'm sure there was something
before or after that) but I'm assuming you got that error when
*generating* the Python binding source code (and not when compiling them).
Py++ runs gccxml to parse the header files when you create the module
builder object. If gccxml cannot parse the files you will get an error
and your script terminates. This is why the code where you try to
exclude the function will never get executed. Excluding a function
doesn't mean it will be excluded from the parsing step, it rather means
that the function will be excluded from the Python bindings.
So before you can actually start working with Py++ you have to make sure
that gccxml is able to parse the header files properly.
I think in your case you have to do the workaround I mentioned in my
other mail (creating local copies of the header files that have the
function bodies removed).
You may still follow Roman's suggestion though and post a message about
this in the gccxml mailing list (as it's really a gccxml problem, not a
Py++ one). Personally, I don't consider this to be a bug in gccxml
though as the offending code apparently is specific to the Microsoft
compiler. As far as I know, the syntax for inline assembly code is not
part of the C/C++ standard, so every compiler can just do whatever it
wants, and I'm not sure if gccxml is meant to be able to emulate all
compilers out there (after all, it's called _GCC_xml). But of course, it
would be nice if gccxml could handle such a case. Personally, I would
prefer an option that instructs gccxml to entirely ignore function
bodies when parsing the code (they are not needed by Py++ anyway), then
this would also fix my problem on OSX. :)
- Matthias -
|