[Pyrex] Please support C++

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Oct 13 05:35:00 CEST 2005


Lenard Lindstrom wrote:

> I've made a few changes to the Pyrex-0.9.3.1 compiler so it now produces C code 
> that also compiles as C++ for some Pyrex programs.

That sounds interesting...

> In making the changes I assumed the staticforward declarations of extension types 
> are unnecessary. I found no place in the compiler where a PyTypeObject variable is 
> refered to before it is declared. Outside of the module init function all access to an 
> extension type appears to be through a pointer. But I would like this confirmed 
> before going any further.

I'll have to think about that, but you may well be right.
It could just be a holdover from an earlier version where
I didn't have the pointers and just referred to the
typeobjects directly.

> Pyrex uses (void *) casts to filling the 
> vtable for an extension type. A C++ compiler simply rejects them. Removing these 
> casts will not be simple.

I suppose they'll have to be cast to the actual type of
the function in the table. I don't think that will be too
hard, unless there's some complication I'm forgetting.
> 
> Finally, how is the best way to make the patch available for general testing? At 7.5K 
> is it too large to be an e-mail attachment?

You're welcome to mail it to me and I'll put it on the
web page somewhere for people to try out.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list