[SciPy-dev] Weave, numpy, external libraries and conflicting typedefs

Prabhu Ramachandran prabhu_r at users.sf.net
Fri Jul 7 03:45:46 CDT 2006


Hi,

I have some C++ code that uses an external library (Ygl).  This
library makes the following typedefs:

    typedef signed   char    Int8;
    typedef unsigned char   Uint8;
    typedef signed   short   Int16;
    typedef unsigned short  Uint16;
    typedef signed   int     Int32;
    typedef unsigned int    Uint32;
    typedef          float  Float32;
    typedef          double Float64;

My C++ code is wrapped to Python and includes the header file that
defines these typedefs.  I use weave to efficiently script this code
from Python.

Earlier, with Numeric, arrayobject.h did not define typedefs for the
Int32 and so on.  However, numpy defines several typedefs that
conflict with the typedefs in Ygl.

Due to this change between Numeric/numpy my weave code that uses both
the C++ header files (which include Ygl's headers) and the
arrayobject.h no longer compiles.  I could try and work around the
problem in my code but would like to know if this can be handled in
numpy.

Any clarifications will be much appreciated.

Thanks!

cheers,
prabhu


More information about the Scipy-dev mailing list